主题
sortedUniqBy
js
_.sortedUniqBy(array, [iteratee])此方法与 _.uniqBy 类似,只是它是为排序数组设计和优化的。
¥This method is like _.uniqBy except that it's designed and optimized for sorted arrays.
新增于
¥Since
4.0.0
参数
¥Arguments
array(数组):要检查的数组。¥
array(Array): The array to inspect.[iteratee](函数):每个元素调用迭代器。¥
[iteratee](Function): The iteratee invoked per element.
返回
¥Returns
(数组):返回新的重复释放数组。
¥(Array): Returns the new duplicate free array.
示例
¥Example
js
_.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
// => [1.1, 2.3]