js plus string code example
Example 1: js concat string
const str1 = 'Hello';
const str2 = 'World';
console.log(str1.concat(' ', str2));
// expected output: "Hello World"
console.log(str2.concat(', ', str1));
// expected output: "World, Hello"
Example 2: string concat in js
let string1 = "Hello"
let string2 = "World"
let finalString = string1 + ", " + string2 + "!" // Hello, World!