Javascript for loop efficiency
- by Misha Moroshko
Is
for (var i=0, cols=columns.length; i<cols; i++) { ... }
more efficient than
for (var i=0; i<columns.length; i++) { ... }
?
In the second variant, is columns.length calculated each time the condition i<columns.length is checked ?