Out of curiosity I did this simple concatenation:
let a;
a+="hello"
console.log(a)
It returns "undefinedhello"
I get that a was basically the string "undefined", or is it converted to a string when concatenating? Is there something to learn here?
let a="";
a+="hello"
console.log(a)
since you are creating a variable here so the default value becomes undefined . You need to assign a value over there.