CollectionEach()
call the given UDF/Closure with every entry (key/value) in the given collection.
CollectionEach( collection=object, closure=function );
Returns: void
| Argument | Description |
|---|---|
|
collection
object,
required
|
edit
collection to take values from Alias: object |
|
closure
function,
required
|
edit
UDF/Closure that call with the entries from struct Alias: function, callback, udf |
Examples
editpeople = [ { name = "Alice", age = 32 }, { name = "Bob", age = 29 }, { name = "Eve", age = 41 }];
CollectionEach(people, function(p) { dump(p.name); });
// member function
people.each(function(p) {
dump(p.name);
});
See also
- Collections
- Search Issue Tracker open_in_new
- Search Lucee Test Cases open_in_new (good for further, detailed examples)