Created
November 22, 2014 09:15
-
-
Save alessioalex/203526d1e4e34eaf4c7e to your computer and use it in GitHub Desktop.
settimeout-iif.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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