This method is like `pullAll` 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 iteratee is invoked with one argument: (value). **Note:** Unlike `differenceBy`, this method mutates `array`.
const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]
pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x')
console.log(array)
// => [{ 'x': 2 }]
Name | Type | Attribute | Description |
---|---|---|---|
array | The array to modify. | ||
values | The values to remove. | ||
iteratee | The iteratee invoked per element. |
{ "comment": "/**\r\n * This method is like `pullAll` except that it accepts `iteratee` which is\r\n * invoked for each element of `array` and `values` to generate the criterion\r\n * by which they're compared. The iteratee is invoked with one argument: (value).\r\n *\r\n * **Note:** Unlike `differenceBy`, this method mutates `array`.\r\n *\r\n * @since 4.0.0\r\n * @category Array\r\n * @param {Array} array The array to modify.\r\n * @param {Array} values The values to remove.\r\n * @param {Function} iteratee The iteratee invoked per element.\r\n * @returns {Array} Returns `array`.\r\n * @see pull, pullAll, pullAllWith, pullAt, remove, reject\r\n * @example\r\n *\r\n * const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]\r\n *\r\n * pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x')\r\n * console.log(array)\r\n * // => [{ 'x': 2 }]\r\n */", "meta": { "range": [ 859, 1041 ], "filename": "pullAllBy.js", "lineno": 25, "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo", "code": { "id": "astnode100007162", "name": "pullAllBy", "type": "FunctionDeclaration", "paramnames": [ "array", "values", "iteratee" ] } }, "description": "This method is like `pullAll` except that it accepts `iteratee` which is\rinvoked for each element of `array` and `values` to generate the criterion\rby which they're compared. The iteratee is invoked with one argument: (value).\r\r**Note:** Unlike `differenceBy`, this method mutates `array`.", "since": "4.0.0", "tags": [ { "originalTitle": "category", "title": "category", "text": "Array", "value": "Array" } ], "params": [ { "type": { "names": [ "Array" ] }, "description": "The array to modify.", "name": "array" }, { "type": { "names": [ "Array" ] }, "description": "The values to remove.", "name": "values" }, { "type": { "names": [ "function" ] }, "description": "The iteratee invoked per element.", "name": "iteratee" } ], "returns": [ { "type": { "names": [ "Array" ] }, "description": "Returns `array`." } ], "see": [ "pull, pullAll, pullAllWith, pullAt, remove, reject" ], "examples": [ "const array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]\r\rpullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x')\rconsole.log(array)\r// => [{ 'x': 2 }]" ], "name": "pullAllBy", "longname": "pullAllBy", "kind": "function", "scope": "global", "___id": "T000002R000657", "___s": true, "filepath": "pullAllBy.js" }