Created
January 1, 2019 11:47
-
-
Save SastraNababan/97055effc3434cb48284f2a6c4503610 to your computer and use it in GitHub Desktop.
This file contains 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
// ============== Scope & Hoisting ============= | |
/* | |
// global scope | |
{ | |
// local scope | |
} | |
*/ | |
console.log("_______________________"); | |
let myGlobal = "global scope"; | |
{ | |
console.log(myGlobal); | |
let myLocal = "local scope"; | |
var myLocal2 = "local scope (var)"; | |
} | |
console.log(myGlobal); | |
{ | |
let myLocal = "another local scope"; | |
console.log(myLocal); | |
console.log(myLocal2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment