arrayMap
arrayMap(array array, function callback) → array newArray
Returns a new array containing, for each key in the source array, the value returned by the callback function. If the callback function takes one parameter, the source array's value is sent; if it takes two parameters, the first is the key and the second is the value.
Returns a new array containing, for each value of the source array array, the value returned by the callback function.
The callback function takes 1 to 3 parameters, in this order: (value, position, source array).
Parameters
- array: Source array.
- callback: Function called for each element.
Return
Notes
- In LeekScript <= 3, if the callback function takes one parameter, the value from the source array is sent; if it takes two parameters, the key and the value are sent.