7927ba144b7d15420a1e2fda76cbaa3da508969b
[platform/framework/web/crosswalk-tizen.git] /
1 var baseDifference = require('../internal/baseDifference'),
2     isArguments = require('../lang/isArguments'),
3     isArray = require('../lang/isArray'),
4     restParam = require('../function/restParam');
5
6 /**
7  * Creates an array excluding all provided values using `SameValueZero` for
8  * equality comparisons.
9  *
10  * **Note:** [`SameValueZero`](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-samevaluezero)
11  * comparisons are like strict equality comparisons, e.g. `===`, except that
12  * `NaN` matches `NaN`.
13  *
14  * @static
15  * @memberOf _
16  * @category Array
17  * @param {Array} array The array to filter.
18  * @param {...*} [values] The values to exclude.
19  * @returns {Array} Returns the new array of filtered values.
20  * @example
21  *
22  * _.without([1, 2, 1, 3], 1, 2);
23  * // => [3]
24  */
25 var without = restParam(function(array, values) {
26   return (isArray(array) || isArguments(array))
27     ? baseDifference(array, values)
28     : [];
29 });
30
31 module.exports = without;