I need some help separating my app into the top 3 most common values that show up in the array.
I can't wrap my head around how to do this. I've tried several array methods or pushing into empty arrays but I don't know how to approach this problem.
var businessNames = ['walmart', '7-eleven', 'mcdonalds', 'walmart', 'mcdonalds', 'mcdonalds', 'DQ', 'bestbuy', 'sonic', 'DQ', 'DQ', 'DQ', 'sonic', ]
//my function didnt work so i won't show my sad attempt