Skip to content

Instantly share code, notes, and snippets.

@tanisha03
Created February 2, 2020 12:27
Show Gist options
  • Select an option

  • Save tanisha03/3d7aa4d71c7828604143e6865c3158f8 to your computer and use it in GitHub Desktop.

Select an option

Save tanisha03/3d7aa4d71c7828604143e6865c3158f8 to your computer and use it in GitHub Desktop.
Understanding Lexical Scoping
function greet(){
name="Tanisha"; //local variable for greet()
function sayHello(){ //inner function
alert("Hello"+name); //access to the variable
}
sayHello();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment