Home > @wixc3/common > groupBy
Groups elements by the value of a property
Signature:
export declare function groupBy<T, K extends keyof T>(elements: Iterable<T>, property: K): Map<T[K], T[]>;
Parameter | Type | Description |
---|---|---|
elements | Iterable<T> | |
property | K |
Returns:
Map<T[K], T[]>
A map of the value to an array of elements