Only get .length one time in for loop

I just read this : http://www.w3.org/wiki/JavaScript_best_practices#Optimize_loops

Will proberly make the code a little faster.
Merge pull request #226 from scootergrisen/patch-6

Only get .length one time in for loops