Iterate Odd Numbers With a For Loop not working

Tell us what’s happening:
i am getting wanted result i need but it is not accepting it in the repl but not in the free code
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/iterate-odd-numbers-with-a-for-loop
link for the lesson

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(var i=1;i<10;i+=2){
  myArray.push(i);
}

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 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

What tests are you not passing?

Add the console.log at the last line:

console.log(myArray);

Then check on your console you will get output as:
(5) [1, 3, 5, 7, 9]

This seems to be correct.

guys i have restarted the chrome then i get passed

1 Like