Partitions an array into two arrays based on a predicate.
Element type.
Array to partition.
Predicate function.
[falsey, truthy] tuple.
[falsey, truthy]
partition([1, 2, 3, 4], (n) => n % 2 === 0); // [[1, 3], [2, 4]] Copy
partition([1, 2, 3, 4], (n) => n % 2 === 0); // [[1, 3], [2, 4]]
Partitions an array into two arrays based on a predicate.