84});
85
86socket.on('usertyping',(data)=>{
87 feedback.innerHTML="<p><em>"+data.sendby + "is" + "typing"+"</em></p>";88});
89
90socket.on('usernottyping',(data)=>{
84});
85
86socket.on('usertyping',(data)=>{
87 feedback.innerHTML="<p><em>"+data.sendby + "is" + "typing"+"</em></p>";88});
89
90socket.on('usernottyping',(data)=>{
It's unnecessary to concatenate two string literals together, such as:
let foo = "a" + "b";
This code is likely the result of refactoring where a variable was removed from the concatenation (such as "a" + b + "b"). In such a case, the concatenation isn't important and the code can be rewritten as:
let foo = "ab";
let a = `some` + `string`;
// these are the same as "10"
a = '1' + '0';
a = '1' + `0`;
a = `1` + '0';
a = `1` + `0`;
// when a non string is included
let c = a + b;
c = '1' + a;
let a = 1 + '1';
c = 1 - 2;
// when the string concatenation is multiline
c = "foo" + "bar";