groupBy

fun <T : Any, K : PropertyKey> groupBy(items: ReadonlyArray<T>, keySelector: (value: T, index: Int) -> K): ReadonlyRecord<K, ReadonlyArray<T>>(source)