Groups each item in the array of items into a map according to the keySelector
There are two overloads:
groupBy(items, keySelector)
– groups the original items using the key returned by
keySelector
.groupBy(items, keySelector, valueSelector)
– groups transformed values using the key returned
by keySelector
and the value returned by valueSelector
.If valueSelector
is not provided, the original item is used in the resulting groups.
Map of keys to groups of values corresponding to each item.
Groups each item in the array of items into a map according to the keySelector
There are two overloads:
groupBy(items, keySelector)
– groups the original items using the key returned bykeySelector
.groupBy(items, keySelector, valueSelector)
– groups transformed values using the key returned bykeySelector
and the value returned byvalueSelector
.If
valueSelector
is not provided, the original item is used in the resulting groups.