I was exploring the Google Closure Compiler, and one thing I noticed was that it converts while(true)
into for(;;)
.
Both do hang the browser, but why does the empty for
loop not break out of itself immediately? The second part of it is empty, and therefore falsy. Isn't it true that when the second part is falsy, the for
loop stops and execution continues with code which comes after the for
loop?
Could someone perhaps give an explanation for this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…