find max values in object type in node js 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: js max value of array
let numbers = [4, 13, 27, 0, -5]; // Get max value of an array in Javascript
Math.max.apply(null, numbers); // returns 27