Possible Duplicate:
How to sort an array of javascript objects?
I have output that looks like this:
[ { value: 1, count: 1 }, { value: 2, count: 2 } ]
I need to iterate through hashes in the array and then return the value number which has the highest count. Seems simple but I'm a bit stumped. I've tried using a separate array to save both sets of values but I can't figure out the best way to do it.