Last active
May 17, 2017 23:09
-
-
Save littleli/1a1b27bbc143a171b334f780f49f199b to your computer and use it in GitHub Desktop.
Bicycle
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 Bicycle { | |
constructor(public cadence: number, private _speed: number, public gear: number) {} | |
speed = this._speed | |
applyBrake = (decrement: number) => this._speed -= decrement | |
sppedUp = (increment: number) => this._speed += increment | |
toString = () => `Bicycle: ${this._speed} mph` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment