Skip to content

Instantly share code, notes, and snippets.

@heapwolf heapwolf/7.js
Created Jul 19, 2012

Embed
What would you like to do?
intro/async
var i = 0;
while( ++ i <= 4) {
setTimeout(function() {
console.log(i);
}, i);
}
@heapwolf

This comment has been minimized.

Copy link
Owner Author

commented Jul 19, 2012

Output

5
5
5
5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.