Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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 ]
 
PREVIOUS NEXT
Tagged: #Iterate #Odd #Numbers #With #For #Loop
ADD COMMENT
Topic
Name
7+2 =