-
-
Save bdelaney/1835441 to your computer and use it in GitHub Desktop.
javascript closure
This file contains hidden or 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
| outer = function () { | |
| var a = 1; | |
| var inner = function () { | |
| alert(a); | |
| } | |
| return inner; | |
| } | |
| fnc = outer(); | |
| fnc(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment