Module: util/itertools
Functions
groupBy
▸ groupBy<T
, U
>(list
, func
): Map
<U
, T
[]>
Returns a map where the elements are grouped based on the value of func
for
the given elements.
Type parameters
Name |
---|
T |
U |
Parameters
Name | Type | Description |
---|---|---|
list | T [] | LIst of elements to group |
func | (element : T ) => U | Function to map elements to group key |
Returns
Map
<U
, T
[]>
Map from group keys to list of elements mapped to given key
Defined in
util/itertools.ts:8