Am I missing something?

Tell us what’s happening:

Your code so far


// Setup
var myArray = [];

// Only change code below this line.
var i = 5;
while(i < 0) {
myArray.push(i);
i--;
}

console.log(myArray);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.

Challenge: Iterate with JavaScript While Loops

Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/iterate-with-javascript-while-loops

What’s happening here?

1 Like

I used the wrong comparison. corrected :slight_smile: !

1 Like