Skip to content

Instantly share code, notes, and snippets.

@kuznetsovandrey76
Created September 8, 2018 16:28
Show Gist options
  • Select an option

  • Save kuznetsovandrey76/48948e066da69ea6ab6f51ee665d542d to your computer and use it in GitHub Desktop.

Select an option

Save kuznetsovandrey76/48948e066da69ea6ab6f51ee665d542d to your computer and use it in GitHub Desktop.
Геттер, Сеттер
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