@vsokolov/utils - v0.32.0
    Preparing search index...

    Function countBy

    • Count the number of times each element occurs in the array

      Parameters

      • array: (string | number)[]

        Array of elements to count

      Returns Record<string, number>

      Object where keys are array values and values are the count of occurrences