✓ Baseline 2015
Array.prototype.map()
Creates a new array populated with the results of calling a provided function on every element in the calling array.
Syntax
map(callbackFn)
map(callbackFn, thisArg)
map(callbackFn, thisArg)
Parameters
callbackFn
A function to execute for each element in the array. Its return value is added as a single element in the new array.
thisArg
optional
Value to use as this when executing callbackFn.
Return value
Array
A new array with each element being the result of the callback function. Always the same length as the source array.
Browser support
All major browsers since 2015
Cr
Ff
Sf
Ed
No