Skip to main content

pullAllWith

_.pullAllWith(comparator, values, array) # Ⓢ [Ⓣ][1] Ⓝ

This method is like _.pullAll except that it accepts comparator which



is invoked to compare elements of array to values. The comparator is



invoked with two arguments: (arrVal, othVal).




Since​

4.6.0

Arguments​

  1. comparator (Function): The comparator invoked per element.
  2. values (Array): The values to remove.
  3. array (Array): The array to modify.

Returns​

(Array): Returns array.

Example​

var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];

_.pullAllWith(_.isEqual, [{ 'x': 3, 'y': 4 }], array);
// => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]