1 var baseIteratee = require('./_baseIteratee'),
2 basePullAll = require('./_basePullAll');
5 * This method is like `_.pullAll` except that it accepts `iteratee` which is
6 * invoked for each element of `array` and `values` to generate the criterion
7 * by which they're compared. The iteratee is invoked with one argument: (value).
9 * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
15 * @param {Array} array The array to modify.
16 * @param {Array} values The values to remove.
17 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
18 * @returns {Array} Returns `array`.
21 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
23 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
27 function pullAllBy(array, values, iteratee) {
28 return (array && array.length && values && values.length)
29 ? basePullAll(array, values, baseIteratee(iteratee, 2))
33 module.exports = pullAllBy;