Review


#1



Why is this infinitely looping? I see no error.


// Write your code below!
var condition = true;
for(var i = 1; i < 11; i++){
    console.log(i);
}
do {
    console.log(" is ");
}
while (condition) {
    console.log(condition);
    condition = false;
}


#2

there are two types of while loops, do while:

do {

} while (condition)

and while loop:

while(condition){

}

you can not combine a do while and while loop to a do while while loop like you did


#3

// Write your code below!
var condition = true;
do {
    console.log(" is ");
} while (condition);
condition = false;

Tried this and it still didn't work


#4

you need to update the condition inside the loop, otherwise condition will always be true


#5

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