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
link for the lesson

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<10;i+=2){

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:

What tests are you not passing?

Add the console.log at the last line:


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