builtGroupBy<K> method

BuiltMap<K, BuiltList<T>> builtGroupBy<K>(
  1. K fn(
    1. T element
    )
)

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

Implementation

BuiltMap<K, BuiltList<T>> builtGroupBy<K>(K Function(T element) fn) {
  return map((e) => MapEntry(fn(e), e)).toBuiltMapList();
}