Returns a collector that partitions the source into two arrays based on a predicate.
Type of items in the source.
Predicate function to determine which array an element should be added to.
Collector that partitions the source into two arrays based on a predicate.
const result = partition<number>((x) => x > 1)([1, 2, 3]);console.log(result); // [[2, 3], [1]] Copy
const result = partition<number>((x) => x > 1)([1, 2, 3]);console.log(result); // [[2, 3], [1]]
Returns a collector that partitions the source into two arrays based on a predicate.