Skip to content

Instantly share code, notes, and snippets.

@jackpordi
Last active September 11, 2019 23:05
Show Gist options
  • Save jackpordi/a34fbaa65bc40b20b49f3a6544846900 to your computer and use it in GitHub Desktop.
Save jackpordi/a34fbaa65bc40b20b49f3a6544846900 to your computer and use it in GitHub Desktop.
class Counter {
constructor() {
this.count = 0;
}
increment() {
this.count++;
}
getCount() {
return this.count;
}
printCount() {
console.log(this.count);
}
}
myCounter = new Counter();
counter.increment();
console.log(counter.getCount());
counter.printCount();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment