javascript custom max code example
Example: array with objects read element with the lowest value
myArray.reduce(function(prev, curr) {
return prev.Cost < curr.Cost ? prev : curr;
});
myArray.reduce(function(prev, curr) {
return prev.Cost < curr.Cost ? prev : curr;
});