Consider this code:
var age = 3; console.log("I'm " + age + " years old!");
Are there any other ways to insert the value of a variable in to a string, apart from string concatenation?
Since ES6, you can use template literals:
const age = 3 console.log(`I'm ${age} years old!`)
1.4m articles
1.4m replys
5 comments
57.0k users