Hey! This is the dev blog for the app named gosnip.
If you need a neat way to organize your code, gosnip, it's free.

This blog talks about the how's and why's behind gosnip and features articles and tutorials on the techniques used.

JavaScript loop performance

Robert Nyman, the original author of the perfect little JS library, DOMAssistant, has done a little loop speed test and has come to a very useful conclusion that saves a lot of processing time. Next time you do a for loop through an array, start by saving the array.length into a variable, and use that:

for (var i=0, il=divs.length; i // Magic
}

Why is this faster? Well, if we don’t use the variable il, and do the loop like (i=0; i

Leave a Reply