From e56f3461846b624aaea02bc7c68ffc0d9ba2a955 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 29 Nov 2020 11:23:01 +0200 Subject: [PATCH] Update takeWhile.md --- snippets/takeWhile.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/takeWhile.md b/snippets/takeWhile.md index 1574bcb6f..2177e2071 100644 --- a/snippets/takeWhile.md +++ b/snippets/takeWhile.md @@ -3,10 +3,10 @@ title: takeWhile tags: array,intermediate --- -Removes elements in an array until the passed function returns `true`. +Removes elements in an array until the passed function returns `false`. Returns the removed elements. -- Loop through the array, using a `for...of` loop over `Array.prototype.entries()` until the returned value from the function is `true`. +- Loop through the array, using a `for...of` loop over `Array.prototype.entries()` until the returned value from the function is `false`. - Return the removed elements, using `Array.prototype.slice()`. ```js