-
-
Save Zylophone/b539c6fac5ba277129843cc1d4daba3c 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 functional_scoping() { | |
| var x = "outside if"; | |
| if(true){ | |
| var x = "inside if"; | |
| } | |
| console.log(x); | |
| } | |
| functional_scoping(); | |
| function block_scoping() { | |
| let x = "outside if"; | |
| if(true){ | |
| let x = "inside if"; | |
| } | |
| console.log(x); | |
| } | |
| block_scoping(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment