Consider this code:
var age = 3; console.log(\"I\'m \" + age + \" years old!\");
Are there any other ways to insert the value of a variabl
Try sprintf library (a complete open source JavaScript sprintf implementation). For example:
vsprintf('The first 4 letters of the english alphabet are: %s, %s, %s and %s', ['a', 'b', 'c', 'd']);
vsprintf takes an array of arguments and returns a formatted string.