Count occurrences of each unique element in the array
Array of data to count occurrences
Object with unique elements as keys and their occurrence counts as values
Count occurrences of each unique element in the array