定义
class Point {
constructor(x,y) {
this.x = x;
this.y = y
}
action() {
}
}
var p = new Point(1,2);
继承
class Point {
constructor(x,y) {
this.x = x;
this.y = y
}
action() {
consloe.log(this.x+this.y)
}
}
class A extends Point {
constructor(x,y,b) {
super(x,y) //继承父亲的属性和方法
this.z = b
}
var a = new A(1,2,4);
console.log(a.action()) //继承父亲的属性
}
typeof(class) //function