Answers for "Iterate Odd Numbers With a For Loop"

0

Iterate Odd Numbers With a For Loop

var myArray = [];
for (var i = 1; i < 10; i += 2){
    myArray.push(i);
}
console.log(myArray); // console output [ 1, 3, 5, 7, 9 ]
Posted by: Guest on December-21-2020

Code answers related to "Iterate Odd Numbers With a For Loop"

Code answers related to "Javascript"

Browse Popular Code Answers by Language