Skip to content

@lang:any

Whether at least one element satisfies the predicate.

On-chain (@lang:any!): Predicates return bool and stop at the first decisive result. Supports typed dynamic arrays and word-specialized predicates.

Returns: bool

@lang:any(arr fn)
NameTypeDescription
arrarraySource array
fnhelperPredicate helper returning bool
  • @all — true if all match
  • @filter — keep matching elements
  • @count: how many match

Return true if a named boolean callback matches any element, stopping at the first match. Empty arrays return false. Callbacks support composed helpers and ABI calls over typed single-word or multiword elements.

A predicate that compares one call over the element with a value, such as a balance against a minimum, costs one call per element. The value may be a call of its own: it is read once, not once per element.