The sorted array-like object to search.
The value to locate in the array.
The 3-way comparison function to apply to the values.
It should return < 0 if an element is less than a value, 0 if
an element is equal to a value, or > 0 if an element is greater
than a value.
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 element which compares
>=to a value.Returns
The index of the first element which compares
>=to the value, orlengthif there is no such element. If the computed index forstopis less thanstart, then the computed index forstartis returned.Notes
The array must already be sorted in ascending order according to the comparison function.
Complexity
Logarithmic.
Undefined Behavior
Searching a range which is not sorted in ascending order.
A
startorstopwhich is non-integral.Modifying the length of the array while searching.
Example