Skip to content

Instantly share code, notes, and snippets.

@DennisDurairaj
Created May 11, 2020 19:08
Show Gist options
  • Save DennisDurairaj/e7a59eb66f2fca0e217f623e4ae39b95 to your computer and use it in GitHub Desktop.
Save DennisDurairaj/e7a59eb66f2fca0e217f623e4ae39b95 to your computer and use it in GitHub Desktop.
let a = 'global scope';
function outer() {
let b = 'outer scope';
function inner() {
let c = 'inner scope'
console.log(c); // Output: 'inner scope'
console.log(b); // Output: 'outer scope'
console.log(a); // Output: 'global scope'
}
console.log(a); // Output: 'global scope'
console.log(b); // Output: 'outer scope'
inner();
}
outer();
console.log(a); // Output: 'global scope'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment