Is
for (var i=0, cols=columns.length; i
more efficient than
for (var i=0; i
Any expression that's in the second portion of a for will be evaluated once per loop.
So, here, with your second proposition, yes, columns.length
will be calculated each time the condition is checked -- which would make the first proposition faster than the second one.
(That's true for many other languages, btw)