Emits all elements of an Iterable while a Predicate matches.
Terminates the Iterable when the Predicate returns false.
false
const takeWhileLessThan3 = takeWhile(x => x < 3);const iterable = takeWhileLessThan3([1,2,3,4]);console.log(iterable); // [1,2]
dropWhile, limit and skip for similar operations.
an Iterable that emits values until the Predicate returns false
the Iterable value type
the Predicate to match
Generated using TypeDoc
Emits all elements of an Iterable while a Predicate matches.
Terminates the Iterable when the Predicate returns
false.Example
See
dropWhile, limit and skip for similar operations.
Returns
an Iterable that emits values until the Predicate returns
false