• Groups the elements of the given array by the key returned by the given key function.

    Type Parameters

    • T
    • K

    Parameters

    • arr: readonly T[]
    • keyFn: (elem: T) => K

    Returns Map<K, T[]>