Splits an array into two groups: items matching predicate and items that do not. Returns [matched, unmatched].
predicate
[matched, unmatched]
The source array.
Function to test each item.
partitionArray([1, 2, 3, 4, 5], n => n % 2 === 0)// => [[2, 4], [1, 3, 5]] Copy
partitionArray([1, 2, 3, 4, 5], n => n % 2 === 0)// => [[2, 4], [1, 3, 5]]
Splits an array into two groups: items matching
predicateand items that do not. Returns[matched, unmatched].