Created
May 11, 2020 19:08
-
-
Save DennisDurairaj/e7a59eb66f2fca0e217f623e4ae39b95 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 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