array.indexWhere()
Get the index of an Array element that matches the given predicate.
Signature
indexWhere(predicate: () => Boolean | Null) => Number | Null
indexWhere(predicate: () => Boolean | Null, start: Number) => Number | Null
Description
The indexWhere()
method searches, left-to-right, for the element that
matches predicate and returns the index of the element if a match is
found.
If the optional start is included, predicate searches right-to-left starting at start and returns the matching index, inclusive.
Return value
Type | Description |
---|---|
Index of element that matches predicate or |
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!