This method is like pull except that it accepts an array of values to remove.
pull
Note: Unlike difference, this method mutates array.
difference
array
The array to modify.
The values to remove.
Returns array.
5.11.0
[[pull]], [[pullAllBy]], [[pullAllWith]], [[pullAt]], [[remove]], [[reject]]
const array = ['a', 'b', 'c', 'a', 'b', 'c']pullAll(array, ['a', 'c'])console.log(array)// => ['b', 'b'] Copy
const array = ['a', 'b', 'c', 'a', 'b', 'c']pullAll(array, ['a', 'c'])console.log(array)// => ['b', 'b']
This method is like
pull
except that it accepts an array of values to remove.Note: Unlike
difference
, this method mutatesarray
.