Function arrayToCountedMap

  • Count distinct values in an array

    Type Parameters

    • T

    Parameters

    • array: Map<T, number> | T[]

      Array of values

    Returns Map<T, number>

    Map of distinct values to count