map()

An Array method that creates a new array by transforming every item.

What does map() do in JavaScript?

map() — An Array method that creates a new array by transforming every item.

const prices = [2, 3, 4];
const doubled = prices.map(price => price * 2);

Level: Journeyman · More JavaScript terms at this level

Updated

In other subjects