|
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:
710 bytes
|
| Line | |
|---|
| 1 | var basePullAll = require('./_basePullAll');
|
|---|
| 2 |
|
|---|
| 3 | /**
|
|---|
| 4 | * This method is like `_.pull` except that it accepts an array of values to remove.
|
|---|
| 5 | *
|
|---|
| 6 | * **Note:** Unlike `_.difference`, this method mutates `array`.
|
|---|
| 7 | *
|
|---|
| 8 | * @static
|
|---|
| 9 | * @memberOf _
|
|---|
| 10 | * @since 4.0.0
|
|---|
| 11 | * @category Array
|
|---|
| 12 | * @param {Array} array The array to modify.
|
|---|
| 13 | * @param {Array} values The values to remove.
|
|---|
| 14 | * @returns {Array} Returns `array`.
|
|---|
| 15 | * @example
|
|---|
| 16 | *
|
|---|
| 17 | * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
|
|---|
| 18 | *
|
|---|
| 19 | * _.pullAll(array, ['a', 'c']);
|
|---|
| 20 | * console.log(array);
|
|---|
| 21 | * // => ['b', 'b']
|
|---|
| 22 | */
|
|---|
| 23 | function pullAll(array, values) {
|
|---|
| 24 | return (array && array.length && values && values.length)
|
|---|
| 25 | ? basePullAll(array, values)
|
|---|
| 26 | : array;
|
|---|
| 27 | }
|
|---|
| 28 |
|
|---|
| 29 | module.exports = pullAll;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.