Skip to content

Instantly share code, notes, and snippets.

@gcr
Created January 16, 2009 07:13
Show Gist options
  • Save gcr/47857 to your computer and use it in GitHub Desktop.
Save gcr/47857 to your computer and use it in GitHub Desktop.
a = {"a":1,"b": 2,"c": 3}
for (i in a) {
setTimeout(function(){console.log(i + " " + a[i]);},250);
}
/* Output:
c 3
c 3
c 3
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment