Iterate over Arrays with map 2

Iterate over Arrays with map 2
0

#1

Hello, I don’t understand what is wrong with this code. The map function just doesn’t seem to work. I figured it out. Tried it. Didn’t work. Then I simply copy and pasted the answers found from forums that were said to work (almost identical to what I originally had) and it still didn’t work.

This would be the first encounter I have had to not be able to check off my list and my OCD is now starting to kick in.
It passes all test except “You should add three to each value in the array.” and the array stays the same like I didn’t even tell it to do anything [1,2,3,4,5].

Please help

Your code so far


// Only change code below this line.
var oldArray = [1,2,3,4,5];

// Only change code below this line.

var newArray = oldArray.map(function(val){
  return val + 3;
});

var newArray = oldArray;

#2

Why are you doing this? This code makes newArray the same as oldArray.


#3

SMH… thanks
Wrote the code and didn;t see it preset it for me