Last active
August 29, 2015 14:15
-
-
Save daytonn/ec5326a6e73685da6747 to your computer and use it in GitHub Desktop.
CWCPOOJS - 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
| var tellSecrets = function() { | |
| var secret = "shh, don’t tell anyone"; | |
| return function() { | |
| console.log(secret); | |
| }; | |
| }(); | |
| tellSecrets(); | |
| console.log(secret); // undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment