Re:Google Closure: How not to write Javascript
by jeff18 on Thursday November 12, 2009 @02:06AM
(#937315)
It would have to determine that arr.length doesn't change during the loop. Pretty difficult problem. :)
http://closure-compiler.appspot.com/home
And whether I checked "Simple" or "Advanced" I got:
for(var a = 0;a < arr.length;a++)
So it's not optimizing that pattern yet.