@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
Syntax
Section titled “Syntax”@lang:find(arr fn)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
arr | array | Source array |
fn | helper | Predicate helper returning bool |
See Also
Section titled “See Also”On-chain face (@find!)
Section titled “On-chain face (@find!)”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.