Last active
June 9, 2019 20:03
-
-
Save CodeDraken/6b2fc26daed5549db3fc1ca05ee7070b to your computer and use it in GitHub Desktop.
block scope example 2
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
| // block scoping - literal blocks | |
| function blockScope () { | |
| let a = 5 | |
| { | |
| const blockedVar = 'blocked' | |
| var b = 11 | |
| a = 9000 | |
| } | |
| console.log('a =', a) | |
| console.log('b =', b) | |
| console.log('blockedVar =', blockedVar) | |
| } | |
| blockScope() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment