Created
November 14, 2018 22:46
-
-
Save kselax/942fc316d965043f9bcd11dfd76b768b to your computer and use it in GitHub Desktop.
let scope
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
| { | |
| var x = 11 | |
| { | |
| let x = 10 | |
| { | |
| console.log('x (unknown) = ', x); // can you guess which x here? | |
| function f() { | |
| var a = 1 | |
| { | |
| var a = 2 | |
| { | |
| var a = 30 | |
| } | |
| console.log('a = ', a); // 30 | |
| } | |
| console.log('a = ', a); // 30 | |
| } | |
| f() | |
| } | |
| console.log('x = ', x); // 30 | |
| } | |
| console.log('x = ', x); // 30 | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment