ArrayMap
Iterates over every entry of the array and calls the closure function to work on the element of the array.
The returned value will be set at the same index in a new array and the new array will be returned
Method Signature
Arguments
Argument | Type | Required | Description | Default |
---|---|---|---|---|
|
|
| The array to reduce | |
|
|
| The function to invoke for each item. The function will be passed 3 arguments: the current item, and the current index, and the original array. You can alternatively pass a Java Function which will only receive the 1st arg. The function should return the value that will be set at the same index in the new array. | |
|
|
|
| |
|
|
| ||
|
|
|
Examples
Related
Last updated