0
class Rectangle {
constructor(w, h) {
this.w = w;
this.h = h;
}
}
Rectangle.prototype.area = funcion() {
var area = this.w * this.h;
return area;
}
class Square extends Rectangle {
constructor(w){
this.w=w;
this.h=w;
}
}
Wenn ich versuche, diesen Code auszuführen, es gibt Fehler folgende:Fehler in Prototyp-Syntax von JavaScript-Klasse
solution.js:10
Rectangle.prototype.area=funcion() {
^ SyntaxError: Unexpected token {