mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
734 B
28 lines
734 B
9 years ago
|
var baseDifference = require('./_baseDifference'),
|
||
|
isArrayLikeObject = require('./isArrayLikeObject'),
|
||
|
rest = require('./rest');
|
||
10 years ago
|
|
||
|
/**
|
||
9 years ago
|
* Creates an array excluding all given values using
|
||
9 years ago
|
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||
10 years ago
|
* for equality comparisons.
|
||
|
*
|
||
|
* @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]
|
||
|
*/
|
||
9 years ago
|
var without = rest(function(array, values) {
|
||
|
return isArrayLikeObject(array)
|
||
10 years ago
|
? baseDifference(array, values)
|
||
|
: [];
|
||
|
});
|
||
|
|
||
|
module.exports = without;
|