Skip to content

@any

Return true if at least one element satisfies the predicate.

Returns: bool

@any(arr fn)
Name Type Description
arr array Source array
fn helper Predicate helper returning bool
# Check if any negative
def @isNegative "$n: number -> bool" @bool($n < 0)
print @any([1 -2 3] @isNegative)
  • @all — true if all match
  • @filter — keep matching elements