function getMax(array) { let max = array.reduce(function(max,cur){ return max=max>cur?max:cur; }) return max; }