mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
29 lines
877 B
JavaScript
29 lines
877 B
JavaScript
define(['../internal/baseDifference', '../internal/baseSlice'], function(baseDifference, baseSlice) {
|
|
|
|
/**
|
|
* Creates an array excluding all provided values using `SameValueZero` for
|
|
* equality comparisons.
|
|
*
|
|
* **Note:** `SameValueZero` comparisons are like strict equality comparisons,
|
|
* e.g. `===`, except that `NaN` matches `NaN`. See the
|
|
* [ES spec](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
|
|
* for more details.
|
|
*
|
|
* @static
|
|
* @memberOf _
|
|
* @category Array
|
|
* @param {Array} array The array to filter.
|
|
* @param {...*} [values] The values to exclude.
|
|
* @returns {Array} Returns the new array of filtered values.
|
|
* @example
|
|
*
|
|
* _.without([1, 2, 1, 3], 1, 2);
|
|
* // => [3]
|
|
*/
|
|
function without(array) {
|
|
return baseDifference(array, baseSlice(arguments, 1));
|
|
}
|
|
|
|
return without;
|
|
});
|