Javascript Array sort() get highest value

Description

Javascript Array sort() get highest value

var points = [40, 10, 1, 5, 25, 10];
console.log(points);/*from www . ja v  a  2s.  c  om*/

points.sort(function(a, b){return b-a});
console.log(points[0]);



PreviousNext

Related