Skip to content

@find

Return the first element that satisfies the predicate.

Returns: any

@find(arr fn)
Name Type Description
arr array Source array
fn helper Predicate helper returning bool
# Find first even number
def @isEven "$n: number -> bool" @bool(@num($n % 2) == 0)
set $nums [1 3 4 6]
set $first @find($nums @isEven)