export class Triangle { base: number; height: number; area: number; constructor() { this.base = 0; this.height = 0; this.area = 0; } calcArea() { this.area = this.base * this.height / 2; } }