Created
September 8, 2018 16:28
-
-
Save kuznetsovandrey76/48948e066da69ea6ab6f51ee665d542d to your computer and use it in GitHub Desktop.
Геттер, Сеттер
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
| function Counter() { | |
| this.counter = 0; | |
| return { | |
| add: function() { | |
| counter++; | |
| }, | |
| get: function() { | |
| return counter; | |
| }, | |
| set: function(value) { | |
| counter = value; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment