Skip to content

Instantly share code, notes, and snippets.

@Philmod
Created July 7, 2013 00:51
Show Gist options
  • Save Philmod/5941834 to your computer and use it in GitHub Desktop.
Save Philmod/5941834 to your computer and use it in GitHub Desktop.
for (var i=0; i<10; i++) {
setTimeout(function() { // to simulate a random I/O call
console.log('i = ', i);
}, 100);
}
/*
i = 10
i = 10
i = 10
i = 10
i = 10
i = 10
i = 10
i = 10
i = 10
i = 10
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment