Is it possible to have the number of occurrences of each value in an array?
For example :
items = ["pineapple", "apples", "tomatoes", "water", "apples","tomatoes"];
I want to display :
pineapple appears 1 time, apples appears 2 times etc..
Is it possible to have the number of occurrences of each value in an array?
For example :
items = ["pineapple", "apples", "tomatoes", "water", "apples","tomatoes"];
I want to display :
pineapple appears 1 time, apples appears 2 times etc..