var numbers = [time1, time2, time3];
// Sorting the numbers array simply using the sort method
numbers.sort(); // Sorts numbers array
document.write(numbers + "<hr>"); // Outputs: 1,12,15,3,5,7,9
/* Sorting the numbers array numerically in ascending order
using the sort method and a compare function */
numbers.sort(function(a, b){
return a - b;
});
document.write(numbers); // Outputs: 1,3,5,7,9,12,15
}
This is my code at the moment. It reads three values defined elsewhere at runtime and puts them into the correct numerical order. How could I remove a value if it was equal to 0 and then assigning states to each number? Basically a first, second, and third basis for a race state.