-
-
Save cferdinandi/3d73dee1e3fc7954928177013a2bfea2 to your computer and use it in GitHub Desktop.
This file contains 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 MyLibrary { | |
/** | |
* Create the constructor object | |
* @param {Number} start The starting amount | |
*/ | |
constructor (start = 0) { | |
this.total = start; | |
} | |
/** | |
* Add money to the total | |
*/ | |
add (num = 1) { | |
this.total = this.total + num; | |
} | |
/** | |
* Remove money from the total | |
*/ | |
subtract (num = 1) { | |
this.total = this.total - num; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment