I was exploring the Google Closure Compiler, and one thing I noticed was that it converts while(true)
into for(;;)
.
Both do hang the browse
From the ECMAScript language specification:
IterationStatement : for (ExpressionNoIn_opt ; Expression_opt ; Expression_opt) Statement
If the first Expression is present, then
Since the first expression (the second argument to for) is not present, this section is never run, so the for loop does not exit.