sortedIndex
_.sortedIndex(array, value, [iteratee], [context])
使用二分查找确定 value 在 list 中的位置序号,value 按此序号插入能保持 list 原有的排序。如果提供 iteratee 函数,iterator 将作为 list 排序的依据,包括你传递的 value 。iterator 也可以是字符串的属性名用来排序(比如 length
)。
_.sortedIndex(array, value, [iteratee], [context])
使用二分查找确定 value 在 list 中的位置序号,value 按此序号插入能保持 list 原有的排序。如果提供 iteratee 函数,iterator 将作为 list 排序的依据,包括你传递的 value 。iterator 也可以是字符串的属性名用来排序(比如 length
)。