mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 01:47:48 +00:00
Bump to v4.0.0.
This commit is contained in:
27
without.js
Normal file
27
without.js
Normal file
@@ -0,0 +1,27 @@
|
||||
var baseDifference = require('./internal/baseDifference'),
|
||||
isArrayLikeObject = require('./isArrayLikeObject'),
|
||||
rest = require('./rest');
|
||||
|
||||
/**
|
||||
* Creates an array excluding all provided values using
|
||||
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
|
||||
* 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]
|
||||
*/
|
||||
var without = rest(function(array, values) {
|
||||
return isArrayLikeObject(array)
|
||||
? baseDifference(array, values)
|
||||
: [];
|
||||
});
|
||||
|
||||
module.exports = without;
|
||||
Reference in New Issue
Block a user