map
Summary
Apply a function to each element of a list.
Tip
This function is curried.
Description
Take a function fn
then a list xs
.
Return a list of the same type with the result of applying fn
to each element of xs
.
Examples
Works with arrays and objects.
1 2 3 4 5 6 7 |
|
Parameters
Name | Type | Description |
---|---|---|
fn | function |
|
xs | Array or Object |
Return
Array
or Object