CollectionEvery()
This function calls a given closure/function with every element in a given collection and returns true, if all of the closure calls returns true.
CollectionEvery( collection=object, closure=function, parallel=boolean, maxThreads=number );
Returns: Boolean
Examples
people = [ { name = "Alice", age = 32 }, { name = "Bob", age = 29 }, { name = "Eve", age = 41 }];
dump(CollectionEvery(people, function(p) { return p.age > 20; })); // true
// member function
dump(people.every(function(p) { return p.age > 30; })); // false
See also
- Collections
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)