1 var basePullAll = require('./_basePullAll');
4 * This method is like `_.pullAll` except that it accepts `comparator` which
5 * is invoked to compare elements of `array` to `values`. The comparator is
6 * invoked with two arguments: (arrVal, othVal).
8 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
14 * @param {Array} array The array to modify.
15 * @param {Array} values The values to remove.
16 * @param {Function} [comparator] The comparator invoked per element.
17 * @returns {Array} Returns `array`.
20 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
22 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
24 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
26 function pullAllWith(array, values, comparator) {
27 return (array && array.length && values && values.length)
28 ? basePullAll(array, values, undefined, comparator)
32 module.exports = pullAllWith;