Skip to content

Instantly share code, notes, and snippets.

@avalan4e57
Last active April 23, 2019 06:53
Show Gist options
  • Save avalan4e57/73bc4a502815cf3e1539080e31df1ef5 to your computer and use it in GitHub Desktop.
Save avalan4e57/73bc4a502815cf3e1539080e31df1ef5 to your computer and use it in GitHub Desktop.
Lexical environment: global and functional
// 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