Array Map

The map method creates a new array populated with the results of calling a provided function on every element.

Snippet:

const squares = arr.map(num => num * num);

Example:

const names = users.map(user => user.name);