Home

function: pullAll


pullAll(array: Array, values: Array): Array

This method is like `pull` except that it accepts an array of values to remove. **Note:** Unlike `difference`, this method mutates `array`.

Example(s):

const array = ['a', 'b', 'c', 'a', 'b', 'c']

pullAll(array, ['a', 'c'])
console.log(array)
// => ['b', 'b']

Params:

Name Type Attribute Description
array The array to modify.
values The values to remove.

Returns:

Array

  {
    "comment": "/**\r\n * This method is like `pull` except that it accepts an array of values to remove.\r\n *\r\n * **Note:** Unlike `difference`, 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 * @returns {Array} Returns `array`.\r\n * @see pull, pullAllBy, pullAllWith, pullAt, remove, reject\r\n * @example\r\n *\r\n * const array = ['a', 'b', 'c', 'a', 'b', 'c']\r\n *\r\n * pullAll(array, ['a', 'c'])\r\n * console.log(array)\r\n * // => ['b', 'b']\r\n */",
    "meta": {
        "range": [
            598,
            758
        ],
        "filename": "pullAll.js",
        "lineno": 22,
        "path": "C:\\Users\\beaujeup\\projects\\jsdoc-template\\examples\\lodash\\lodash-repo",
        "code": {
            "id": "astnode100007128",
            "name": "pullAll",
            "type": "FunctionDeclaration",
            "paramnames": [
                "array",
                "values"
            ]
        }
    },
    "description": "This method is like `pull` except that it accepts an array of values to remove.\r\r**Note:** Unlike `difference`, 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"
        }
    ],
    "returns": [
        {
            "type": {
                "names": [
                    "Array"
                ]
            },
            "description": "Returns `array`."
        }
    ],
    "see": [
        "pull, pullAllBy, pullAllWith, pullAt, remove, reject"
    ],
    "examples": [
        "const array = ['a', 'b', 'c', 'a', 'b', 'c']\r\rpullAll(array, ['a', 'c'])\rconsole.log(array)\r// => ['b', 'b']"
    ],
    "name": "pullAll",
    "longname": "pullAll",
    "kind": "function",
    "scope": "global",
    "___id": "T000002R000655",
    "___s": true,
    "filepath": "pullAll.js"
}