Skip to main content

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

NameTypeDescription
listT[]LIst of elements to group
func(element: T) => UFunction 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