Re:Google Closure: How not to write JavaScript
by gruseom on Monday December 13, 2010 @12:18PM
(#2001137)
Perhaps you were seeing GC events slowing down the test?
Perhaps. Or perhaps it varies by array size?
Re:Google Closure: How not to write JavaScript
by bluekeybox on Monday December 13, 2010 @12:43PM
(#2001272)
Then do not write code like this.
Perhaps you were seeing GC events slowing down the test?
The other thing about for(var i=0;i<arr.length;i++) is it can end up as an infinite loop if you're modifying the length inside the for loop: