Created
February 5, 2013 22:13
-
-
Save austinbv/4718219 to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { | |
var x = 1; | |
console.log("before setTimeout 1"); | |
setTimeout(function() { | |
console.log("timeout 1"); | |
x = 2; | |
}, 0); | |
x = 3; | |
console.log("after setTimeout 1"); | |
(function(y) { | |
console.log("before setTimeout 2: " + y ); | |
setTimeout(function() { | |
console.log(y); | |
console.log("timeout 2: " + y); | |
}, 0); | |
console.log("after setTimeout 2: " + y); | |
})(x); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment