concat string and var js code example
Example 1: how to concatenate strings and variables in javascript
const helloName = name => `Hello ${name}!`
Example 2: 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"