Skip to content

Instantly share code, notes, and snippets.

@cgradwohl
Created April 30, 2018 19:54
Show Gist options
  • Save cgradwohl/b90c5ed34e64e13e5143bf85254934f9 to your computer and use it in GitHub Desktop.
Save cgradwohl/b90c5ed34e64e13e5143bf85254934f9 to your computer and use it in GitHub Desktop.
lexical scope example
var x = "!";
var outer = () => {
var a = "there";
var inner = () => console.log("Hey " + a + x);
return inner();
}
outer(); // --> "Hey there!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment