Skip to content

Documentation / @ripl/utilities / arrayGroup

Function: arrayGroup()

arrayGroup<TValue>(input, identity): Record<PropertyKey, TValue[]>

Defined in: packages/utilities/src/collection.ts:111

Groups array items by a property key or indexer function into a keyed record.

Type Parameters

Type Parameter
TValue

Parameters

ParameterType
inputTValue[]
identityArrayGroupIdentity<TValue>

Returns

Record<PropertyKey, TValue[]>