Add reference to #pull
This commit is contained in:
@ -4,6 +4,8 @@ Filters out the elements of an array, that have one of the specified values.
|
|||||||
|
|
||||||
Use `Array.filter()` to create an array excluding(using `!Array.includes()`) all given values.
|
Use `Array.filter()` to create an array excluding(using `!Array.includes()`) all given values.
|
||||||
|
|
||||||
|
_(For a snippet that mutates the original array see [`pull`](#pull))_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const without = (arr, ...args) => arr.filter(v => !args.includes(v));
|
const without = (arr, ...args) => arr.filter(v => !args.includes(v));
|
||||||
// without([2, 1, 2, 3], 1, 2) -> [3]
|
// without([2, 1, 2, 3], 1, 2) -> [3]
|
||||||
|
|||||||
Reference in New Issue
Block a user