1 var baseIndexOf = require('../internal/baseIndexOf');
3 /** Used for native method references. */
4 var arrayProto = Array.prototype;
6 /** Native method references. */
7 var splice = arrayProto.splice;
10 * Removes all provided values from `array` using
11 * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
12 * for equality comparisons.
14 * **Note:** Unlike `_.without`, this method mutates `array`.
19 * @param {Array} array The array to modify.
20 * @param {...*} [values] The values to remove.
21 * @returns {Array} Returns `array`.
24 * var array = [1, 2, 3, 1, 2, 3];
26 * _.pull(array, 2, 3);
34 if (!(array && array.length)) {
38 indexOf = baseIndexOf,
41 while (++index < length) {
45 while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
46 splice.call(array, fromIndex, 1);
52 module.exports = pull;