BUG in 2. While syntax in JavaScript course


#1
  1. While syntax

There is a BUG.

When you try to submit this code GoogleChrome is blocked.

var understand = true;

while(true){
console.log("I'm learning while loops!");
understand = false;
}

Everybody can to try it.


#2

this:

while(true)

will be an infinity loop, true is always true

maybe look at the instructions for a hint about while loop condition?


#3

The problem is not in the mistake in the code, the problem is that browser in the Tab is blocked. Because I must to close this Tab and open a new Tab and start again.


#4

an infinity loop will freeze the browser tab, you coded an infinity loop. So yes, there is a problem with your code


#5

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