findfirst
Finds the first element of a collection that satisfies a condition.
.var {numbers}
- 3
- 8
- 12
.numbers::findfirst {n: .n::isgreater than:{5}} <!-- 8 -->Content copied to clipboard
Return
the first element that satisfies condition, or none if no element does
Parameters
from
collection to search in
condition
condition to check, which accepts one argument (the current element) and returns a boolean