This method is like `uniqBy` except that it's designed and optimized for sorted arrays.
sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor)
// => [1.1, 2.3]
Name | Type | Attribute | Description |
---|---|---|---|
array | The array to inspect. | ||
iteratee | The iteratee invoked per element. |
{ "comment": "/**\r\n * This method is like `uniqBy` except that it's designed and optimized\r\n * for sorted arrays.\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {Array} array The array to inspect.\r\n * @param {Function} iteratee The iteratee invoked per element.\r\n * @returns {Array} Returns the new duplicate free array.\r\n * @example\r\n *\r\n * sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor)\r\n * // => [1.1, 2.3]\r\n */", "meta": { "range": [ 469, 603 ], "filename": "sortedUniqBy.js", "lineno": 17, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100008633", "name": "sortedUniqBy", "type": "FunctionDeclaration", "paramnames": [ "array", "iteratee" ] } }, "description": "This method is like `uniqBy` except that it's designed and optimized\rfor sorted arrays.", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Array", "value": "Array" } ], "params": [ { "type": { "names": [ "Array" ] }, "description": "The array to inspect.", "name": "array" }, { "type": { "names": [ "function" ] }, "description": "The iteratee invoked per element.", "name": "iteratee" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns the new duplicate free array." } ], "examples": [ "sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor)\r// => [1.1, 2.3]" ], "name": "sortedUniqBy", "longname": "sortedUniqBy", "kind": "function", "scope": "global", "___id": "T000002R000790", "___s": true, "filepath": "sortedUniqBy.js" }