这里的for循环为什么不加{} 我尝试加了{} 反而出不来了 求解释
var cnt = 0;
for (var i = 0; i<balls.length;i++)
if(balls[i].x + Rediaus >0 && balls[i].x - Rediaus < windowWidth )
balls[cnt++] = balls[i]
while(balls.length > Math.min(300,cnt) ){
balls.pop();
}
var cnt = 0;
for (var i = 0; i<balls.length;i++)
if(balls[i].x + Rediaus >0 && balls[i].x - Rediaus < windowWidth )
balls[cnt++] = balls[i]
while(balls.length > Math.min(300,cnt) ){
balls.pop();
}
2017-07-31
举报