Created
August 7, 2018 19:20
-
-
Save qwertie/4623dab626ad07e1834906f1a8868e00 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 Box { | |
width: number; | |
height: number; | |
constructor(width: number, height: number) { | |
this.width = width; | |
this.height = height; | |
} | |
get area() { return this.width*this.height; } | |
setSquare(side: number) { | |
this.width = this.height = side; | |
} | |
static ZeroSize() { return new Box(0, 0); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment