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
// interface ensure class instance shape. Notice that the interface includes the parameters of the constructor, not the properties | |
interface Vehicle { | |
make: string; | |
color: string; | |
doors: number; | |
accelerate(speed: number): string; | |
brake(): string; | |
turn(direction: 'left' | 'right'): string; | |
} |
NewerOlder