root / HServer / 00.Server / 00.Program / node_modules / lodash / pullAll.js
이력 | 보기 | 이력해설 | 다운로드 (710 Bytes)
| 1 | 39 | HKM | 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; |