I'm building a Tinder like app in Angular. When the user swipes right, I am grabbing information about that object. All the images can be part of one of 6 collections.
The user can only swipe right 4 times. Which means I have 4 scenarios. What I'm looking to do is count the number of instances of all of the collections that were swiped right. I hope that makes sense.
So for instance if I end up with an array like this:
[a, b, a, d]
The winner will be A. I'm not quite sure how to count all of those and determine A as the winner.
Any and all help is appreciated!