Created
November 24, 2011 21:53
-
-
Save jlfwong/1392387 to your computer and use it in GitHub Desktop.
No block scope, no variable hoisting
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
// Let's assume we have neither block scope nor variable hoisting. | |
if (foo) { | |
var x = 7; | |
} | |
console.log(x); | |
// We now either have a 7 printed or a Reference error. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment