Skip to content

Instantly share code, notes, and snippets.

@richtaur
Created April 8, 2011 04:13
Show Gist options
  • Select an option

  • Save richtaur/909268 to your computer and use it in GitHub Desktop.

Select an option

Save richtaur/909268 to your computer and use it in GitHub Desktop.
Iterates through an array with a reference to each property
var things = [
'a',
'b',
'c'
];
for (var i = 0, thing; thing = things[i]; ++i) {
console.log(i, thing);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment