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