add reference to #without

This commit is contained in:
Simon Legg
2017-12-18 14:11:16 +00:00
committed by GitHub
parent 19aae4ec50
commit a26c70864b

View File

@ -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.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
const pull = (arr, ...args) => {
let pulled = arr.filter((v, i) => !args.includes(v));