Answers for "loop through a number backwards"

PHP
1

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 ]
Posted by: Guest on December-21-2020

Code answers related to "loop through a number backwards"

Browse Popular Code Answers by Language