Files
lodash/without.js
John-David Dalton ce0b51888c Bump to v4.7.0.
2016-03-31 00:36:47 -07:00

29 lines
739 B
JavaScript

import baseDifference from './_baseDifference';
import isArrayLikeObject from './isArrayLikeObject';
import rest from './rest';
/**
* 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 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)
: [];
});
export default without;