collectionEach

Iterate over each item contained in the collection given

collectionEach(collection, closure) → returns void

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

Argument Reference

collection any
Required

closure function
Required

Examples
Sample code invoking the collectionEach function

coll = [{
    id: 0,
    name: 'me'
},{
    id: 1,
    name: 'you'
}];
collectionEach(coll,function(item) {
    writeOutput(item.name);
    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