Skip to content

Instantly share code, notes, and snippets.

@Daniel-Hug
Created October 4, 2013 05:15
Show Gist options
  • 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