JavaScript · Junior · Question 22 of 75

What does [1, 2, 3].map(x => x * 2) return?

Explanation

map creates a new array from the callback's results without changing the original. Similar non-mutating methods: filter (selection), reduce (folding into one value), find, some, every.

Further reading

Problem with a question

JavaScript · Junior · question 22

Test yourself

Take the JavaScript · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz