View Subcategory

Test if a condition holds for all items of a list

Given a list, test if a certain logical condition (i.e. predicate) holds for all items of the list.
fantom
echo([2,3,4].all{ it>1 })

Test if a condition holds for any items of a list

Given a list, test if a certain logical condition (i.e. predicate) holds for any items of the list.
fantom
echo([2,3,4].any{ it==4 })