_.sortedIndexOf(array, value)
This method is like _.indexOf
except that it performs a binary search on a sorted array
.
Since
4.0.0
Arguments
array
(Array): The array to inspect.value
(*): The value to search for.
Returns
(number): Returns the index of the matched value, else -1
.
Example
_.sortedIndexOf([4, 5, 5, 5, 6], 5);// => 1
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .