Skip to content

Instantly share code, notes, and snippets.

@ikushaldave
Created August 17, 2020 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ikushaldave/70e176e739d6565ed58221d46f39c5ae to your computer and use it in GitHub Desktop.
Save ikushaldave/70e176e739d6565ed58221d46f39c5ae to your computer and use it in GitHub Desktop.
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