The following code doesn’t work as expected. How can I stop it from concatenating?
function blah(){
let testArray = [1,2,3,4,5];
console.log('testArray[0]+1 = ' + testArray[0]+1);
}
https://jsfiddle.net/ut2k67oc/
How to I get this to add an array element to another integer instead of concatenating?
3
Answers
Use parenthesis
You can use the template literals