Last active
September 11, 2019 23:05
-
-
Save jackpordi/a34fbaa65bc40b20b49f3a6544846900 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
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