ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
## sortedUniqBy + [link](./sortedUniqBy "Link to this entry.") + [source](https://github.com/lodash/lodash/blob/4.5.0正式版/lodash.src.js#L6607 "View in source.") + [npm](https://www.npmjs.com/package/lodash.sorteduniqby "See the npm package.") ``` _.sortedUniqBy(array, [iteratee]) ``` 这个方法类似 `_.uniqBy`,除了它接受一个 iteratee 调用每一个数组和值来排序并优化数组。 ### 参数 1. array (Array) 要调整的数组 2. [iteratee] (Function) 这个函数会处理每一个元素 ### 返回值 (Array) 返回一个不重复的数组 ### 示例 ``` _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); // => [1.1, 2.3] ```