UNPKG

685 BJavaScriptView Raw
1import basePullAll from './_basePullAll';
2
3/**
4 * This method is like `_.pull` except that it accepts an array of values to remove.
5 *
6 * **Note:** Unlike `_.difference`, this method mutates `array`.
7 *
8 * @static
9 * @memberOf _
10 * @since 4.0.0
11 * @category Array
12 * @param {Array} array The array to modify.
13 * @param {Array} values The values to remove.
14 * @returns {Array} Returns `array`.
15 * @example
16 *
17 * var array = [1, 2, 3, 1, 2, 3];
18 *
19 * _.pullAll(array, [2, 3]);
20 * console.log(array);
21 * // => [1, 1]
22 */
23function pullAll(array, values) {
24 return (array && array.length && values && values.length)
25 ? basePullAll(array, values)
26 : array;
27}
28
29export default pullAll;