Update snippet descriptions

This commit is contained in:
Isabelle Viktoria Maciohsek
2020-10-22 20:24:30 +03:00
parent d35575373f
commit 5cb69e3c5c
58 changed files with 195 additions and 126 deletions

View File

@ -3,7 +3,8 @@ title: takeWhile
tags: array,intermediate
---
Removes elements in an array until the passed function returns `true`. Returns the removed elements.
Removes elements in an array until the passed function returns `true`.
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`.
- Return the removed elements, using `Array.prototype.slice()`.