Posted By

stellit on 12/08/08


Tagged

loop performance


Versions (?)

Faster "for" loop in javascript


 / Published in: JavaScript
 

  1. var value;
  2. var theDoc = window.document;
  3. var i = 9;
  4. do {
  5. value = theDoc.getElementById("product_"+i).value;
  6. // ...whatever ...
  7. } while (--i);

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: jamesming on December 9, 2008

how is this faster?

You need to login to post a comment.