```class Shape {
constructor(width , height , color) {
this.width = width;
this.height = height;
this.color = color;
}
draw() {
console.log(`drowing ${this.color} color of`);
}
getArea() {
return this.width*this.height;
}
}
class Triangle extends Shape {
draw() {
super.draw();
console.log(`drowing ${this.color} color!`);
}
getArea() {
return (this.width* this.heigt) / 2;
}
}
const triangle = new Triangle(20,20,'blue');
console.log(triangle.getArea());
return (this.width* this.heigt) / 2;
heigt 写错了,应该是height