Iterate Odd Numbers With a For Loop Help Understanding

Tell us what’s happening:

I passed the challenge but I am looking for some explanation to understand the code better.

What really confused me was the odd numbers. My first attempt was to do an i+= 3 but that narrowed it too much. Then I tried 2 and it worked but I don’t know why. Please could someone explain to me what is going on and why it works.

Your code so far

// Example
var ourArray = [];

for (var i = 0; i < 10; i += 2) {

// Setup
var myArray = [];

// Only change code below this line.

for (var i = 1; i <= 9; i += 2) {

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6.

Link to the challenge:

If you start at the number 1 and keep adding 2 each time, each new number will always be odd. The sequence would be 1, 3, 5, 7, 9,…