Last active
April 23, 2019 06:53
-
-
Save avalan4e57/73bc4a502815cf3e1539080e31df1ef5 to your computer and use it in GitHub Desktop.
Lexical environment: global and functional
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
// Global lexical environment is here | |
let a = 'a' | |
const b = 'b' | |
for (let i = 0; i < 5; i++) { | |
console.log(i) | |
} | |
function foo() { | |
// Functional lexical environment is here | |
let a = 'A' | |
function bar() { | |
// And here is another functional lexical environment | |
let b = 'B' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment