Page Crashes - Iterate Odd Numbers With a For Loop

Page Crashes - Iterate Odd Numbers With a For Loop
0

#1

Tell us what’s happening:
Page crashes when I press “run the tests”

Your code so far


// Example
var ourArray = [];

for (var i = 0; i < 10; i += 2) {
  ourArray.push(i);
}

// Setup
var myArray = [];

// Only change code below this line.
for (i = 1; i < 10; i + 2) {
  myArray.push(i);
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/iterate-odd-numbers-with-a-for-loop/


#2

You need to reassign i a value in the last part of the for loop declaration. Look at the example again for guidance.


#3

You need to assign the 2 to i instead of i + 2 use the += symbol.