Skip to content

Instantly share code, notes, and snippets.

@Daniel-Hug
Created October 4, 2013 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Daniel-Hug/6821253 to your computer and use it in GitHub Desktop.
Save Daniel-Hug/6821253 to your computer and use it in GitHub Desktop.
Decrementing for loop with cached variable
for (var i = document.images.length; i--;) {
document.images[i].src = 'cat.png';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment