Can't pass this lesson: Iterate with JavaScript Do...While Loops

Tell us what’s happening:
Describe your issue in detail here.
Can´t pass this lesson!
I tried on my own and with the “Get a Hint”'s Solution and nothing happen!
Is there something wrong with this lesson? Or is my problem?
Thank you!

  **Your code so far**

// Setup
const myArray = [];
let i = 10;
do {
myArray.push(i);
i++;
}
// Only change code below this line
while (i < 5) {
myArray.push(i);
i++;
}
  **Your browser information:**

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

Challenge: Iterate with JavaScript Do…While Loops

Link to the challenge:

You didn’t pay attention to this line. That can’t be good.

1 Like

The while ends the do…while statement. There should not be a code block attached to it.

1 Like

Thank you for your answer!!

Thank you so much for your answer!!

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