Iterate with JavaScript While Loops II

Tell us what’s happening:
For some reason my answer cannot pass.

**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 11_2_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.90 Safari/537.36.

Challenge: Iterate with JavaScript While Loops

Link to the challenge:

If i is always getting bigger, will it ever be less than 0?

Ahh… many thank Jeremy

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.