groupBy
groupBy<
A>(keyFn): (items) =>Readonly<Record<string, readonlyA[]>>
Defined in: Utils/Rec.ts:156
Groups elements of an array into a record keyed by the result of keyFn. Each key maps to
the array of elements that produced it, in insertion order.
Unlike Dict.groupBy, keys are always strings. Use Dict.groupBy when you need non-string
keys or want to avoid the plain-object prototype chain.
Type Parameters
Section titled “Type Parameters”A
Parameters
Section titled “Parameters”(a) => string
Returns
Section titled “Returns”(
items):Readonly<Record<string, readonlyA[]>>
Parameters
Section titled “Parameters”readonly A[]
Returns
Section titled “Returns”Readonly<Record<string, readonly A[]>>