Skip to content

partitionIndices

partitionIndices<T>(iterable, predicate): [number[], number[]]

Defined in: group/partition-indices.ts:13

partition reporting positions instead of elements — the single-pass equivalent of the map/filter/map chain for index extraction.

T

Iterable<T>

The input iterable.

Predicate<[T]>

Returns true for indices going into the first group.

[number[], number[]]

A tuple [matchingIndices, nonMatchingIndices].