Faster "for" loop in javascript


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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

You need to login to post a comment.