Const
Collects elements from the source iterable until the predicate first returns a truthy value, including that element.
Curried version of _takeToInclusive.
Element type produced by the source iterable.
Predicate receiving each element and its index; iteration stops after it returns a truthy value.
A deferred iterable yielding items up to and including the element that satisfies pred.
pred
Error Rethrows any error thrown by pred.
const inclusive = [..._takeToInclusive([1, 2, 3, 4, 5], (value) => value >= 3)];console.log(inclusive); // [1, 2, 3] Copy
const inclusive = [..._takeToInclusive([1, 2, 3, 4, 5], (value) => value >= 3)];console.log(inclusive); // [1, 2, 3]
or using the curried version:
const inclusive = [ ...pipeInto( [1, 2, 3, 4, 5], takeToInclusive((value) => value >= 3) ),];console.log(inclusive); // [1, 2, 3] Copy
const inclusive = [ ...pipeInto( [1, 2, 3, 4, 5], takeToInclusive((value) => value >= 3) ),];console.log(inclusive); // [1, 2, 3]
Collects elements from the source iterable until the predicate first returns a truthy value, including that element.
Curried version of _takeToInclusive.