Skip to content

Instantly share code, notes, and snippets.

@alessioalex
Created November 22, 2014 09:15
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 alessioalex/203526d1e4e34eaf4c7e to your computer and use it in GitHub Desktop.
Save alessioalex/203526d1e4e34eaf4c7e to your computer and use it in GitHub Desktop.
settimeout-iif.js
function tellMeLater() {
for (var i = 0; i < 10; i++) {
(function(i) {
setTimeout(function() {
console.log(i);
}, 100);
}(i));
}
}
tellMeLater();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment