So the current javascript program I'm working on is a bidding system where users place their bids and the highest one wins. However I'm stuck on the problem of having duplicate bids and how to deal with them. My idea was to take the duplicate bids and put them in a separate array and random between them to declare the winner. So for example I've placed the names of the bidders and their bid into a multidimensional array:
bidarray = [ ['Sarah', 55], ['John', 55], ['Joe', 20], ['David', 30], ['George', 55], ['Yogi', 10] ];
I want to extract the current highest bids that are equal and place them into another array in order to iterate through them and random for the winner. So the duplicate array would be:
duparray = [ ['Sarah, 55], ['John', 55], ['George', 55] ];
Is there a method to do this? My programming skills are beginner level so I'm not sure where to begin. Thank you for any help!