This method is like indexOf except that it performs a binary search on a sorted array.
indexOf
array
The array to inspect.
The value to search for.
Returns the index of the matched value, else -1.
-1
5.11.0
sortedIndexOf([4, 5, 5, 5, 6], 5)// => 1 Copy
sortedIndexOf([4, 5, 5, 5, 6], 5)// => 1
This method is like
indexOf
except that it performs a binary search on a sortedarray
.