Date

“Array” Methods

_.sortedIndexOf(array, value)

source npm package

This method is like _.indexOf except that it performs a binary search on a sorted array.

引入版本

4.0.0

参数
array (Array) : The array to inspect.
value (*) : The value to search for.

返回值
(number) : Returns the index of the matched value, else -1.

示例
_.sortedIndexOf([4, 5, 5, 5, 6], 5);
// => 1