🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## sortedIndexOf + [link](./sortedIndexOf "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6500 "View in source.") + [npm](https://www.npmjs.com/package/lodash.sortedindexof "See the npm package.") ``` _.sortedIndexOf(array, value) ``` 这个方法类似 `_.indexOf`,除了它是执行二进制来检索已经排序的数组的。 ### 参数 1. array (Array) 需要检索的数组 2. value (\*) 要评估位置的值 ### 返回值 (number) 返回匹配值的 index ,否则返回 `-1`. ### 示例 ``` _.sortedIndexOf([1, 1, 2, 2], 2); // => 2 ```