Partitions an array into two arrays based on a predicate function.
Elements for which the predicate returns true go into the first array,
and elements for which it returns false go into the second array.
The relative order of elements is preserved in both output arrays.
Type Parameters
T
The type of the array elements
S
The narrowed type when a type predicate is provided
Partitions an array into two arrays based on a predicate function.
Elements for which the predicate returns
truego into the first array, and elements for which it returnsfalsego into the second array. The relative order of elements is preserved in both output arrays.