AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
## 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 ```