Files
lodash/without.js
John-David Dalton 35cdf6513b Bump to v4.13.0.
2016-05-22 19:35:24 -07:00

30 lines
777 B
JavaScript

import baseDifference from './_baseDifference.js';
import isArrayLikeObject from './isArrayLikeObject.js';
import rest from './rest.js';
/**
* Creates an array excluding all given values using
* [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
* for equality comparisons.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Array
* @param {Array} array The array to inspect.
* @param {...*} [values] The values to exclude.
* @returns {Array} Returns the new array of filtered values.
* @see _.difference, _.xor
* @example
*
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
var without = rest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
});
export default without;