Answers for "js append variable to string"

9

how to concatenate strings javascript

var str1 = "Hello ";
var str2 = "world!";
var res = str1.concat(str2);
// does not change the existing strings, but
// returns a new string containing the text
// of the joined strings.
Posted by: Guest on January-05-2020
0

insert variable in string javascript

var a = 5;
var b = 10;
console.log(`Fifteen is ${a + b}.`);
// "Fifteen is 15.
Posted by: Guest on June-23-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language