get highest value in object javascript code example
Example 1: javascript array find highest value of array of objects by key
Math.max.apply(Math, array.map(function(o) { return o.y; }))
Example 2: find in highest value key from an object javascript
var obj = {a: 1, b: 2, undefined: 1};
Object.keys(obj).reduce((a, b) => obj[a] > obj[b] ? a : b);