diff --git a/snippets/pull.md b/snippets/pull.md index 1ffcc5874..2a16dcba7 100644 --- a/snippets/pull.md +++ b/snippets/pull.md @@ -11,7 +11,7 @@ Use `Array.prototype.length = 0` to mutate the passed in an array by resetting i ```js const pull = (arr, ...args) => { let argState = Array.isArray(args[0]) ? args[0] : args; - let pulled = arr.filter((v, i) => !argState.includes(v)); + let pulled = arr.filter(v => !argState.includes(v)); arr.length = 0; pulled.forEach(v => arr.push(v)); }; @@ -20,4 +20,4 @@ const pull = (arr, ...args) => { ```js let myArray = ['a', 'b', 'c', 'a', 'b', 'c']; pull(myArray, 'a', 'c'); // myArray = [ 'b', 'b' ] -``` \ No newline at end of file +```