What would be the most efficient way to count the number of times a value appears inside an array?
Array example ('apple', 'apple', 'banana', 'banana', 'kiwi')
Ultimately, I want the function to spit out interest for charting purposes (e.g. apple = 40%, banana = 40%, kiwi = 20%)
source share