UIZE JavaScript Framework

PERFORMANCE TEST: Storing Length For Iterator

This test page demonstrates that storing the length of an array in a variable that gets used in the iterator conditional is marginally more efficient than dereferencing the length property of the array object in each iteration.

In the test, an array containing 300,000 elements is iterated using the traditional approach, in the first case dereferencing length in each iteration, and in the second case referencing a variable that stores the length of the array