Skip to content

Instantly share code, notes, and snippets.

@jlfwong
Created November 24, 2011 21:53
Show Gist options
  • Save jlfwong/1392387 to your computer and use it in GitHub Desktop.
Save jlfwong/1392387 to your computer and use it in GitHub Desktop.
No block scope, no variable hoisting
// 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