A couple of array utilities you won't find in Array.prototype 🧵
The first, takeWhile(), traverses your array and keeps adding items to a new array until a predicate returns false.
The second, dropWhile(), does the opposite. It traverses your array and ignores items until a predicate returns false. Then it will give you the rest of the array.
What would you use these for? Well, if you have large arrays, they can (sometimes) be a more efficient alternative than `.filter()` if you know where the data you want is at the start (or the end) of the array. They also come in handy when writing parsers.