Iterate with JavaScript Do...While Loops - Help

Why won’t the below be accepted, not sure how this is wrong?

Change the while loop in the code to a do...while loop so the loop will push only the number 10 to myArray , and i will be equal to 11 when your code has finished running.

var myArray = [];
var i = 10;

// Only change code below this line
do {
} while (i < 5) {

This isn’t the syntax for a do while loop.

1 Like

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