Need help with 11. Review


Tab locks up when I try to run this code.

for (var i = 0; i<5; i++){

var condition = true;

    console.log("please dont crash");
    console.log("Condition is true");
    condition = false;


This will happen if the initial var assignment and the while condition are the same. There is nothing causing the loop to stop.


There is also a problem of syntaxe:

The syntaxe of a do... while statement is:

do {
    code block to be executed //all the code to execute must be here (not after the while)
while (condition);

for more...


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