push into a string javascript code example
Example 1: javascript string concat vs +
It is strongly recommended to use the string
concatenationoperators (+, +=) instead of String.concat
method for perfomance reasons
Example 2: js concatenate strings
const str1 = 'Hello';
const str2 = 'World';
console.log(str1 + str2);
>> HelloWorld
console.log(str1 + ' ' + str2);
>> Hello World