Demo Object:
var foo = {a:1, b:2, c:3, d:4, e:5, f:6, g:7}
Wanted result: (get top 3 keys by value)
{e:5, f:6, g:7}
Explanation:
For a given key/value basic object, how would you get the 3 top values, but not just the values but also the keys? keys could be anything. lets say values are integers.
performance should be in mind.