ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## sortedLastIndex + [link](./sortedLastIndex "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6525 "View in source.") + [npm](https://www.npmjs.com/package/lodash.sortedlastindex "See the npm package.") ``` _.sortedLastIndex(array, value) ``` 这个方法类似 `_.sortedIndex`,除了它返回在 value 中尽可能大的 index 位置。 ### 参数 1. array (Array) 需要检索的已排序数组 2. value (\*) 要评估位置的值 ### 返回值 (number) 返回 value 应该在数组中插入的 index。 ### 示例 ``` _.sortedLastIndex([4, 5], 4); // => 1 ```