Date

“Array” Methods

_.sortedIndex(array, value)

source npm package

Uses a binary search to determine the lowest index at which value should be inserted into array in order to maintain its sort order.

引入版本

0.1.0

参数
array (Array) : The sorted array to inspect.
value (*) : The value to evaluate.

返回值
(number) : Returns the index at which value should be inserted into array.

示例
_.sortedIndex([30, 50], 40);
// => 1