The array to sort
The element to find
The starting index
Optional
hi: anyThe end index to search within
The compare function to check for x
Checks whether x
is a comparable type and returns the result of x.compare(y)
.
Otherwise the return value of the compare function is equivalent to obj === other ? 0 : obj < other ? -1 : 1
The comparison result
An initial value
Other value to compare
Generated using TypeDoc
Returns the index of
x
in a sorted array if found, inO(log n)
using binary search. If the element is not found, returns a negative integer.Returns
The index if the element is found or a negative integer.