You are viewing a single comment's thread. Return to all comments →
Solution using JS let newArr = arr.slice().sort(), most = [undefined, 0], counter = 0; newArr.reduce(function(old, chr){ old == chr ? ++counter > most[1] && (most = [chr, counter]) : (counter = 1) return chr }); return most[0];
Seems like cookies are disabled on this browser, please enable them to open this website
Migratory Birds
You are viewing a single comment's thread. Return to all comments →
Solution using JS let newArr = arr.slice().sort(), most = [undefined, 0], counter = 0;
newArr.reduce(function(old, chr){ old == chr ? ++counter > most[1] && (most = [chr, counter]) : (counter = 1) return chr }); return most[0];