map()
map<
T
,R
>(map
): (arr
) =>R
[]
Maps over the given array, calling the mapping function for each element. Returns a new array of the results.
Type Parameters
• T
• R
Parameters
map
MapFn
<T
, R
>
The mapping function to apply to each element of the array.
Returns
Function
Parameters
arr
T
[]
Returns
R
[]
Remark
pure function
Example
map(x => x * 2)([1, 2, 3, 4, 5]);
// [2, 4, 6, 8, 10]