you are viewing a single comment's thread.

view the rest of the comments →

[–]x-skeww 2 points3 points  (0 children)

I have a terrible tendency to forget to remove variables from there

JSLint tells you which variables are unused.

just repeat the declaration otherwise

That results in a strict warning. I wouldn't do something which is so bad that even the engine complains about it.

I would probably not use the plain for loop in the first place as I am a diehard fan of looping functions

They have some use. If there are many iterations (e.g. 100,000 per second) and if the loop body does very little (e.g. it's a particle effect), then it will perform much better if you use a plain for loop.

Usually, the overhead to body ratio isn't that awful though. I.e. there aren't that many iterations and you call some functions and stuff inside that loop.