为什么当我添加 'for' 时 'setInterval' 停止工作?
<script>
var x=0;
setInterval(function() {counter()},1);
function counter()
{
x++;
}
for(var start=0; start <= 100; start++)
{
alert("x is "+x+" and start is "+start);
}
</script>
为什么当我添加 'for' 时 'setInterval' 停止工作?
<script>
var x=0;
setInterval(function() {counter()},1);
function counter()
{
x++;
}
for(var start=0; start <= 100; start++)
{
alert("x is "+x+" and start is "+start);
}
</script>