Just Learn JS。 在我的脑海里,功能的setTimeout代码区域应该像正常的,但它不是,EXP:setTimeout()如何工作JS
var result = 0;
(function (i){
if(i > 0){
result = result + i;
i = i - 1;
setTimeout("arguments.callee(" + i + ")",100);//arguments.callee(i);
}
else if(i == 0)
return;
}(10));
alert(result);
我希望它警报55而不是10,如果删除setTimeout的,这将是很好。 有人知道为什么吗?
明白了,thxxxxxxxxxx – jfw10973