有人能把while循环转换成for循环吗。我真的很感激。
var index = 0;
while (true)
log(index++);
这里有一个简单的实现:
var index = 0
for (;;)
log(index++)
var x = true;
for (var index = 0; x == true) {
log(index++)
}
//if x is never set to false you could very quickly suffer a memory leak