pull source npm

_.pull(array, [values])

Removes all provided values from array using SameValueZero for equality comparisons.

Note: Unlike _.without, this method mutates array.

Arguments

  1. array (Array)

    The array to modify.

  2. [values] (...*)

    The values to remove.

Returns (Array)

Returns array.

Example

var array = [1, 2, 3, 1, 2, 3];

_.pull(array, 2, 3);
console.log(array);
// => [1, 1]