js insert value into string code example
Example 1: js insert string at position
var a = "I want apple";
var b = " an";
var position = 6;
var output = [a.slice(0, position), b, a.slice(position)].join('');
console.log(output);
Example 2: how to put variable in string javascript
var myInt = 1
console.log(`my variable is ${myInt}`);
// my variable is 1