Transducer which applies predicate pred to each input and only yields values as long as the predicate returned a truthy result. Once the result is falsy, transformation is terminated (by emitting a reduced value).
pred
[...takeWhile((x) => x < 5, range(10))] // [ 0, 1, 2, 3, 4 ]
-
Generated using TypeDoc
Transducer which applies predicate
pred
to each input and only yields values as long as the predicate returned a truthy result. Once the result is falsy, transformation is terminated (by emitting a reduced value).[...takeWhile((x) => x < 5, range(10))] // [ 0, 1, 2, 3, 4 ]