Last active
November 29, 2016 14:28
-
-
Save chebykin/19c936d1301e6dfefa58853156e64cd8 to your computer and use it in GitHub Desktop.
js closure inside loop
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
for(var i = 0; i < 10; i++) { | |
setTimeout(function() { | |
console.log(i); | |
}, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment