Groups array elements by key function

  • Type Parameters

    • T
    • K

    Parameters

    • f: (x: T) => K

      Function to generate group key

    • xs: T[]

      Array to group

    Returns Map<K, T[]>

    Map of groups