What is wrong with this code? I’ve check similar topics and have tried shown solutions but still can’t pass the test. Shows error (“You should add three to each value in the array.”)
My code:
var oldArray = [1,2,3,4,5];
//only change code below this line
var newArray = oldArray.map(function(val) {
return val + 3;
});
console.log(oldArray);
console.log(newArray);
var newArray = oldArray;