A new array
Take your time, follow the code and check your understanding.
The codeArrays
const values = [1, 2, 3];
const doubled = values.map(n => n * 2);
console.log(values[0], doubled[0]);Your answer3 min · no timer
Show solution and explanation
map returns a new array. It does not replace the original primitive elements.
1 2