loop through a number backwards code example
Example: Count Backwards With a For Loop
var myArray = [];
for (var i = 9; i > 0; i -= 2){
myArray.push(i);
}
console.log(myArray); // console output [ 9, 7, 5, 3, 1 ]
var myArray = [];
for (var i = 9; i > 0; i -= 2){
myArray.push(i);
}
console.log(myArray); // console output [ 9, 7, 5, 3, 1 ]