Function that will call the given UDF/Closure with every entry (key/value) in the given collection.

each(collection, closure [, parallel] [, maxThreads]) → returns void

This function requires Lucee.  Not supported on Adobe ColdFusion, etc.

Argument Reference

collection any

Collection to take values from.

closure function

UDF/Closure that is called with each entry from the collection.

parallel boolean
Default: false

Execute the closures in parallel.

maxThreads numeric
Default: 20

Maximum number of threads executed. Ignored when parallel argument is set to false.

Sample code invoking the each function

coll = [{
    id: 0,
    name: 'me'
    id: 1,
    name: 'you'
function outputCollection(item) {
    writeOutput(' - ');

Expected Result: me - you -

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub