Skip to content

Instantly share code, notes, and snippets.

@L1fescape
Created December 26, 2012 17:54
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 L1fescape/4381803 to your computer and use it in GitHub Desktop.
Save L1fescape/4381803 to your computer and use it in GitHub Desktop.
Variation of a for loop in javascript I didn't know you could do.
var files = ["a","s","d","f"];
for (var i = 0, f; f = files[i]; i++) {
console.log(i, f);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment