Created
April 30, 2018 19:54
-
-
Save cgradwohl/b90c5ed34e64e13e5143bf85254934f9 to your computer and use it in GitHub Desktop.
lexical scope example
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
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