|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
858 bytes
|
| Line | |
|---|
| 1 | var baseDifference = require('./_baseDifference'),
|
|---|
| 2 | baseRest = require('./_baseRest'),
|
|---|
| 3 | isArrayLikeObject = require('./isArrayLikeObject');
|
|---|
| 4 |
|
|---|
| 5 | /**
|
|---|
| 6 | * Creates an array excluding all given values using
|
|---|
| 7 | * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|---|
| 8 | * for equality comparisons.
|
|---|
| 9 | *
|
|---|
| 10 | * **Note:** Unlike `_.pull`, this method returns a new array.
|
|---|
| 11 | *
|
|---|
| 12 | * @static
|
|---|
| 13 | * @memberOf _
|
|---|
| 14 | * @since 0.1.0
|
|---|
| 15 | * @category Array
|
|---|
| 16 | * @param {Array} array The array to inspect.
|
|---|
| 17 | * @param {...*} [values] The values to exclude.
|
|---|
| 18 | * @returns {Array} Returns the new array of filtered values.
|
|---|
| 19 | * @see _.difference, _.xor
|
|---|
| 20 | * @example
|
|---|
| 21 | *
|
|---|
| 22 | * _.without([2, 1, 2, 3], 1, 2);
|
|---|
| 23 | * // => [3]
|
|---|
| 24 | */
|
|---|
| 25 | var without = baseRest(function(array, values) {
|
|---|
| 26 | return isArrayLikeObject(array)
|
|---|
| 27 | ? baseDifference(array, values)
|
|---|
| 28 | : [];
|
|---|
| 29 | });
|
|---|
| 30 |
|
|---|
| 31 | module.exports = without;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.