From 3530880ca88872d0fb4771dd67b3527cb9b8dc37 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 17 Dec 2017 11:47:17 +0200 Subject: [PATCH] Update array-pull-(mutates-array).md --- snippets/array-pull-(mutates-array).md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/snippets/array-pull-(mutates-array).md b/snippets/array-pull-(mutates-array).md index 9b91c2c17..3a58225ca 100644 --- a/snippets/array-pull-(mutates-array).md +++ b/snippets/array-pull-(mutates-array).md @@ -1,8 +1,7 @@ ### Array pull (mutates array) -Use `Array.filter()` 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. -Use `Array.push()` to re-populate the original array to equal the pulled values +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. ```js const pull = (arr, ...args) => {