Answers for "find lowest value in an object"

1

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]
Posted by: Guest on May-14-2020
0

array with objects read element with the lowest value

myArray.reduce(function(prev, curr) {
    return prev.Cost < curr.Cost ? prev : curr;
});
Posted by: Guest on May-15-2020

Code answers related to "find lowest value in an object"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language