add reference to #without
This commit is contained in:
@ -5,6 +5,8 @@ Mutates the original array to filter out the values specified.
|
|||||||
Use `Array.filter()` and `Array.includes()` to pull out the values that are not needed.
|
Use `Array.filter()` and `Array.includes()` to pull out the values that are not needed.
|
||||||
Use `Array.length = 0` to mutate the passed in array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
|
Use `Array.length = 0` to mutate the passed in array by resetting it's length to zero and `Array.push()` to re-populate it with only the pulled values.
|
||||||
|
|
||||||
|
_(For a snippet that does not mutate the original array see [`without`](#without))_
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const pull = (arr, ...args) => {
|
const pull = (arr, ...args) => {
|
||||||
let pulled = arr.filter((v, i) => !args.includes(v));
|
let pulled = arr.filter((v, i) => !args.includes(v));
|
||||||
|
|||||||
Reference in New Issue
Block a user