groupBy
groupBy<
K,A>(keyFn): (items) =>ReadonlyMap<K, readonlyA[]>
Defined in: Utils/Dict.ts:84
Groups elements of an array into a dictionary keyed by the result of keyFn. Each key maps
to the array of elements that produced it, in insertion order. Uses the native Map.groupBy
when available, falling back to a manual loop in older environments.
Type Parameters
Section titled “Type Parameters”K
A
Parameters
Section titled “Parameters”(a) => K
Returns
Section titled “Returns”(
items):ReadonlyMap<K, readonlyA[]>
Parameters
Section titled “Parameters”readonly A[]
Returns
Section titled “Returns”ReadonlyMap<K, readonly A[]>