array.map()
Calls the given closure with every element in the given array.
the function returns an array that contains all values returned by the closure.
array.map( closure=function, parallel=boolean, maxThreads=number )
Returns: Array
| Argument | Description |
|---|---|
|
closure
function,
required
|
edit
filter can be a function/closure that implements the following constructor [function(any value[, number index, array array]):any]. Alias: function, callback, udf |
|
parallel
boolean,
optional
|
edit
execute closures parallel |
|
maxThreads
number,
optional
|
edit
maximum number of threads executed, ignored when argument "parallel" is set to false Alias: maxThreadCount |
Examples
edit aNames = ["Marcus","Sarah","Josefine"];
writedump(aNames);
newNames2 = aNames.map(function(item,index,arr){
return {'name':item};
});
writedump(newNames2);