This method is like `difference` except that it accepts `iteratee` which is invoked for each element of `array` and `values` to generate the criterion by which they're compared. The order and references of result values are determined by the first array. The iteratee is invoked with one argument: (value). **Note:** Unlike `pullAllBy`, this method returns a new array.
differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)
// => [1.2]
Name | Type | Attribute | Description |
---|---|---|---|
array | The array to inspect. | ||
values | The values to exclude. | ||
iteratee | The iteratee invoked per element. |
{ "comment": "/**\r\n * This method is like `difference` except that it accepts `iteratee` which\r\n * is invoked for each element of `array` and `values` to generate the criterion\r\n * by which they're compared. The order and references of result values are\r\n * determined by the first array. The iteratee is invoked with one argument:\r\n * (value).\r\n *\r\n * **Note:** Unlike `pullAllBy`, this method returns a new array.\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {Array} array The array to inspect.\r\n * @param {...Array} [values] The values to exclude.\r\n * @param {Function} iteratee The iteratee invoked per element.\r\n * @returns {Array} Returns the new array of filtered values.\r\n * @example\r\n *\r\n * differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r\n * // => [1.2]\r\n */", "meta": { "range": [ 966, 1243 ], "filename": "differenceBy.js", "lineno": 26, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100001833", "name": "differenceBy", "type": "FunctionDeclaration", "paramnames": [ "array", "values" ] }, "vars": { "iteratee": "differenceBy~iteratee" } }, "description": "This method is like `difference` except that it accepts `iteratee` which\ris invoked for each element of `array` and `values` to generate the criterion\rby which they're compared. The order and references of result values are\rdetermined by the first array. The iteratee is invoked with one argument:\r(value).\r\r**Note:** Unlike `pullAllBy`, this method returns a new array.", "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": [ "Array" ] }, "optional": true, "variable": true, "description": "The values to exclude.", "name": "values" }, { "type": { "names": [ "function" ] }, "description": "The iteratee invoked per element.", "name": "iteratee" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns the new array of filtered values." } ], "examples": [ "differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor)\r// => [1.2]" ], "name": "differenceBy", "longname": "differenceBy", "kind": "function", "scope": "global", "___id": "T000002R000205", "___s": true, "filepath": "differenceBy.js" }