Answers for "how to find max value of objects in javascript"

13

find max of array of objects key

Math.max.apply(Math, array.map(function(o) { return o.y; }))
Posted by: Guest on March-05-2020
0

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);
Posted by: Guest on January-20-2021

Code answers related to "how to find max value of objects in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language