Skip to content

sortedUniq

js
_.sortedUniq(array)

此方法与 _.uniq 类似,只是它是为排序数组设计和优化的。

¥This method is like _.uniq except that it's designed and optimized for sorted arrays.

新增于

¥Since

4.0.0

参数

¥Arguments

  1. array (数组):要检查的数组。

    ¥array (Array): The array to inspect.

返回

¥Returns

(数组):返回新的重复释放数组。

¥(Array): Returns the new duplicate free array.

示例

¥Example

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

Lodash v4.17 中文网 - 粤ICP备13048890号