Created
June 22, 2020 18:02
-
-
Save softwarebygabe/768c1b94461b6b449d2098c099b44f0f to your computer and use it in GitHub Desktop.
This would be a typical way to construct an object
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
type Material = 'wood' | 'brick' | 'steel' | |
class House { | |
private rooms: number | |
private floors: number | |
private material: Material | |
constructor(rooms: number, floors: number, material: Material) { | |
this.rooms = rooms | |
this.floors = floors | |
this.material = material | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
construction: