Date

“Array” Methods

_.sortedLastIndexOf(array, value)

source npm package

This method is like _.lastIndexOf 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.

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