def
func:any
any(val, fn)
Return if any the items in a list, dict, or grid match the given test function. If the collection is empty, then return false.
If working with a list, the function takes (val)
or (val, index)
and returns true or false.
If working with a dict, the function takes (val)
or (val, name)
and returns true or false.
If working with a grid, the function takes (row)
or (row, index)
and returns true or false.
If working with a string, the function takes (char)
or (char, index)
and returns true or false.
If working with a stream, then function takes (val)
and returns true or false. See Streams.
Examples:
[1, 3, 5].any v => v.isOdd >> true [2, 4, 6].any(isOdd) >> false