Created
February 4, 2016 22:34
-
-
Save bigbookpl/ac3d4d7afb8235035d20 to your computer and use it in GitHub Desktop.
Clousure JS
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 minus = function(){ | |
| var value = 0; | |
| var min = function(){ | |
| value -= 1; | |
| return value; | |
| } | |
| var get_value = function(){ | |
| return value; | |
| } | |
| return { | |
| min : function(){ value -= 1; return true;}, | |
| get : function(){ return value;} | |
| } | |
| }(); | |
| console.log(minus.min()); | |
| console.log(minus.min()); | |
| console.log(minus.min()); | |
| console.log(minus.min()); | |
| console.log(minus.get()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment