4 ms·
Another trick is to do the loop backwards: for(var i = arr.length - 1; i >= 0; i--){...} I remember seeing a test that noted a visible difference between the t
by zbanks 16y ago
Another trick is to do the loop backwards:
for(var i = arr.length - 1; i >= 0; i--){...}
I remember seeing a test that noted a visible difference between the two. Its arguable, however, if it makes a significant difference in the grand scheme of things...