Function pullAll

  • This method is like pull except that it accepts an array of values to remove.

    Note: Unlike difference, this method mutates array.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • values: T[]

      The values to remove.

    Returns T[]

    Returns array.

    Since

    5.11.0

    See

    [[pull]], [[pullAllBy]], [[pullAllWith]], [[pullAt]], [[remove]], [[reject]]

    Example

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

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