Answers for "Sort the numbers in the array in descending order"

0

Sort the numbers in the array in descending order

var points = [40, 100, 1, 5, 25, 10];
points.sort(function(a, b){return b-a});    // Sort the numbers in the array in descending order
// The first item in the array (points[0]) is now the highest value
Posted by: Guest on June-17-2021

Code answers related to "Sort the numbers in the array in descending order"

Browse Popular Code Answers by Language