groupBy<K, V> function

Map<K, List<V>> groupBy<K, V>(
  1. Func1<V, K> getKey,
  2. Iterable<V> items
)

Splits an iterable into sub-lists stored in a map, based on result of calling getKey function on each element of items, and grouping the results according to values returned.

Implementation

Map<K, List<V>> groupBy<K, V>(Func1<V, K> getKey, Iterable<V> items) =>
    _groupBy(getKey, items);