Function pull

  • Removes all given values from array using SameValueZero for equality comparisons.

    Note: Unlike without, this method mutates array. Use remove to remove elements from an array by predicate.

    Type Parameters

    • T

    Parameters

    • array: T[]

      The array to modify.

    • Rest...args: T[]

    Returns T[]

    Returns array.

    2.0.0

    pullAll, pullAllBy, pullAllWith, pullAt, remove, reject

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

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