Skip to content

Instantly share code, notes, and snippets.

@PhakornKiong
Last active April 7, 2021 13:01
Show Gist options
  • Save PhakornKiong/33463d183b39238f0fe048fe899aebf0 to your computer and use it in GitHub Desktop.
Save PhakornKiong/33463d183b39238f0fe048fe899aebf0 to your computer and use it in GitHub Desktop.
// global scope
let global = "This is global scope"
function foo(){
// inner scope 1
let scope1 = "This is inner scope 1"
function bar(){
// inner scope 2
let scope2 = "This is inner scope 2"
scope1 = "Updating the reference in inner scope 1"
function baz(){
// inner scope 3
let scope2 = 'This is inner scope 3 and does not affect the one in inner scope 2'
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment