Skip to content

@lang:find

First element that satisfies the predicate; no match is an error.

On-chain (@lang:find!): Returns the first matching typed value and stops evaluating predicates immediately; no match reverts.

Returns: any

@lang:find(arr fn)
NameTypeDescription
arrarraySource array
fnhelperPredicate helper returning bool

Return the first element satisfying a named boolean callback and stop immediately. No match raises an error in both modes. The returned value preserves the element type, including strings, tuples, and nested arrays.