Created
August 17, 2020 16:26
-
-
Save ikushaldave/70e176e739d6565ed58221d46f39c5ae 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
let user = "global"; | |
if (true) { | |
let user = "inside if"; | |
console.log(user); // "inside it" | |
} | |
function letScope() { | |
let user = "inside function"; | |
console.log(user) // "inside function" | |
} | |
letScope() | |
console.log(user) // "global" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment