Calls the given closure with every element in the given collection.
the function returns a array or struct (depending on the input) that contains all values returned by the closure.
Lucee Function Reference
Function COLLECTIONMAP
Example
collectionmap(object collection,function closure,[boolean parallel,[number maxThreads]]):object
Arguments
The arguments for this function are set. You can not use other arguments except the following ones.
Name | Type | Required | Default Value | Description |
---|---|---|---|---|
collection | object | Yes | collection to iterate | |
closure | function | Yes | UDF/Closure that is called with every value in the collection | |
parallel | boolean | No | execute closures parallel | |
maxThreads | number | No | 20 | maximum number of threads executed, ignored when argument "parallel" is set to false |