Created
March 19, 2016 21:15
-
-
Save JasonDeving/c82195aed8a45ad3c8c5 to your computer and use it in GitHub Desktop.
lamba
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
| //Lamba | |
| var closureAlert = (function() { | |
| var x = 0; | |
| var alerter = function() { | |
| alert(++x); | |
| } | |
| return alerter; | |
| }()); | |
| // calling itself with a closure | |
| closureAlert(); | |
| closureAlert(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment