The array-like object to search.
The predicate function to apply to the values.
The index of the first element in the range to be
searched, inclusive. The default value is 0. Negative values
are taken as an offset from the end of the array.
The index of the last element in the range to be
searched, inclusive. The default value is -1. Negative values
are taken as an offset from the end of the array.
Generated using TypeDoc
Find the index of the first value which matches a predicate.
Returns
The index of the first matching value, or
-1if no matching value is found.Notes
If
stop < startthe search will wrap at the end of the array.Complexity
Linear.
Undefined Behavior
A
startorstopwhich is non-integral.Modifying the length of the array while searching.
Example