Count the number of times each element occurs in the array
Array of elements to count
Object where keys are array values and values are the count of occurrences
Count the number of times each element occurs in the array