I'm working on a chat app built using HTML, Javascript, Node.js and Socket.io. I want the name of the user that is stored in data.name to appear bold. I tried adding * to the start and end of the variable but it only added asterisk as a text.
What am I doing wrong?
socket.on('receive', data => {
var msger = `${data.message}`;
console.log(msger.length);
if (name.length == 0) {
append(`Anonymous: ${data.message}`, 'left');
} else {
append(`${data.name}: ${data.message}`, 'left');
}
});