CollectionSome()
This function calls a given closure/function with every element in a given collection and returns true, if one of the closure calls returns true.
CollectionSome( 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(CollectionSome(people, function(p) { return p.age > 40; })); // true
// member function
dump(people.some(function(p) { return p.age < 20; })); // false
See also
- Collections
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)