> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/array/sortedlastindex.md).

# \_.sortedLastIndex（获取索引值）

**语法：**

```javascript
_.sortedLastIndex(array, value)
```

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L8022)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.sortedlastindex)

**描述：**

此方法类似于[`_.sortedIndex`](https://lodash.com/docs/4.17.10#sortedIndex)，除了 它返回`value`值 在`array`中尽可能大的索引位置（index）。

**开始版本：**&#x33;.0.0

**参数：**

* `array (Array)`: 要检查的排序数组。
* `avalue (*)`: 要评估的值。

**返回值：**

* `(number)`: 返回 value值 应该在数组array中插入的索引位置 index。

**例子：**

```javascript
_.sortedLastIndex([4, 5, 5, 5, 6], 5);
// => 4
```
