get max value object from object of object in javascript code example
Example 1: object get property with max value javascript
var obj = {a: 1, b: 2, undefined: 1};
Object.keys(obj).reduce((a, b) => (obj[a] > obj[b]) ? a : b);
Example 2: max value array of object javascript
Math.max(...arr.map(o => o.value));