how to concat variable with string in javascript code example
Example 1: how to concatenate strings and variables in javascript
const helloName = name => `Hello ${name}!`
Example 2: javascript concat
let chocholates = ['Mars', 'BarOne', 'Tex'];
let chips = ['Doritos', 'Lays', 'Simba'];
let sweets = ['JellyTots'];
let snacks = [];
snacks.concat(chocholates);
snacks.concat(chocolates, chips, sweets);
Example 3: string concat in js
let string1 = "Hello"
let string2 = "World"
let finalString = string1 + ", " + string2 + "!"