Skip to content

partition

partition<T>(iterable, predicate): [T[], T[]]

Defined in: group/partition.ts:12

Splits an iterable into two groups based on a predicate, in one pass.

T

Iterable<T>

The input iterable.

Predicate<[T]>

Returns true for items going into the first group.

[T[], T[]]

A tuple [matching, nonMatching].