Files
lodash/pullAll.js
2017-01-10 01:46:24 -08:00

28 lines
687 B
JavaScript

import basePullAll from './.internal/basePullAll.js';
/**
* This method is like `pull` except that it accepts an array of values to remove.
*
* **Note:** Unlike `difference`, this method mutates `array`.
*
* @since 4.0.0
* @category Array
* @param {Array} array The array to modify.
* @param {Array} values The values to remove.
* @returns {Array} Returns `array`.
* @example
*
* const array = ['a', 'b', 'c', 'a', 'b', 'c'];
*
* pullAll(array, ['a', 'c']);
* console.log(array);
* // => ['b', 'b']
*/
function pullAll(array, values) {
return (array && array.length && values && values.length)
? basePullAll(array, values)
: array;
}
export default pullAll;