Similar Question:
How can I sort an array of javascript objects?
The data output I'm dealing with is structured like this:
[ { value: 1, count: 1 }, { value: 2, count: 2 } ]
My goal is to loop through the hashes in the array and return the value number that has the highest count. It sounds easy but I find myself stuck. I attempted creating a separate array to store both sets of values but I'm struggling to determine the most efficient approach.