@any
Return true if at least one element satisfies the predicate.
Returns: bool
Syntax
Section titled “Syntax”@any(arr fn)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
arr |
array |
Source array |
fn |
helper |
Predicate helper returning bool |
Examples
Section titled “Examples”# Check if any negativedef @isNegative "$n: number -> bool" @bool($n < 0)print @any([1 -2 3] @isNegative)