var myArray = [1, 5, 8, 4, 0, 3, 6]; myArray.sort(); //[0, 1, 3, 4, 5, 6, 8] myArray.reverse(); //[8, 6, 5, 4, 3, 1, 0]