[ '2:28:20', '2:28:09', '2:27:50', '2:28:19', '2:28:11', '2:28:16' ] how to get min and max in es6 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: filter biggest value javascript object

const max = data.reduce((prev, current) => (prev.y > current.y) ? prev : current)

Example 3: filter max value from array typescript

//EXemple 1 : array of simple type
const array1 = [1,6,8,79,45,21,65,85,32,654];
const max1 = array1.reduce((op, item) => op = op > item ? op : item, 0);

//EXemple 1 : array of object 
const array2 = [ {id: 1, val: 60}, {id: 2, val: 2}, {id: 3, val: 89}, {id: 4, val: 78}];
const max2 = array2.reduce((op, item) => op = op > item.val ? op : item.val, 0);

console.log(max);
console.log(max2);