javascript get max value in array of objects using a for loop 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: max value array of object javascript
Math.max(...arr.map(o => o.value));
Example 3: Obtain smallest value from array of objects in Javascript
myArray.sort(function (a, b) {
return a.Cost - b.Cost
})
var min = myArray[0],
max = myArray[myArray.length - 1]