mapArray()function
mapArray(arr: Iterable<I>, transform: (v: I, ...args: A) => O, ...args: A): ImmutableArray<O>
| Param | Type | |
|---|---|---|
arr | Iterable<I> | The source iterable of items. required |
transform | (v: I, ...args: A) => O | Function applied to each item to produce the output item. required |
args | A | Additional arguments passed through to transform on every call. required |
| Return | |
|---|---|
ImmutableArray<O> | A new array containing each transformed item. |
Transform every item of an iterable into a new array.
Examples
mapArray([1, 2], n => n * 2) // [2, 4]