Link Search Menu Expand Document

Iterate Odd Numbers With a For Loop

Summary

  • In a for loop, the final expression can be changed to other values.

Final Code

// Setup
var myArray = [];

// Only change code below this line

for (var i = 1; i <=9; i+=2) {
  myArray.push(i);
}