add 1 to variable whilst concatenate in a string js code example
Example 1: concantene number in js
Use "" + 5 + 6 to force it to strings.
This works with numerical variables too:
var a = 5;
var b = 6;
console.log("" + a + b);
Example 2: javascript join 2 variables into string
A = 'hello ';
B = 'world!';
// outputs "hello world!"
console.log(A + B);