Split an array into two subarrays using a predicate function
the two partitions
const [even, odd] = partitionArray([1, 2, 3, 4], x => x % 2 === 0)even === [2, 4]odd === [1, 3]
the array to partition
the boolean predicate to split along
Generated using TypeDoc
Split an array into two subarrays using a predicate function
Returns
the two partitions
Example