@newdash/newdash
Version:
javascript/typescript utility library
37 lines (36 loc) • 1.1 kB
JavaScript
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.pull = void 0;
const pullAll_1 = __importDefault(require("./pullAll"));
/**
* Removes all given values from `array` using
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
* for equality comparisons.
*
* **Note:** Unlike `without`, this method mutates `array`. Use `remove`
* to remove elements from an array by predicate.
*
* @since 5.11.0
* @category Array
* @param array The array to modify.
* @param values The values to remove.
* @returns Returns `array`.
* @see [[pullAll]], [[pullAllBy]], [[pullAllWith]], [[pullAt]], [[remove]], [[reject]]
* @example
*
* ```js
* const array = ['a', 'b', 'c', 'a', 'b', 'c']
*
* pull(array, 'a', 'c')
* console.log(array)
* // => ['b', 'b']
* ```
*/
function pull(array, ...values) {
return (0, pullAll_1.default)(array, values);
}
exports.pull = pull;
exports.default = pull;