> 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/sorteduniqarray.md).

# \_.sortedUniq（数组去重）

**语法：**

```javascript
_.sortedUniq(array)
```

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

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

**描述：**

这个方法类似[`_.uniq`](https://lodash.com/docs/4.17.10#uniq)，\_.sortedUniq它会优化排序数组。

> 先排序后数组去重

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

**参数：**

* `array (Array)`: 要检查的数组。&#x20;

**返回值：**

* `(Array)`: 返回一个新的不重复的数组。

**例子：**

```javascript
_.sortedUniq([1, 1, 2]);
// => [1, 2]
```
