类的继承
//定义父类
class cars{
constructor(color,size,weight){
this.color=color
this.size=size
this.weight...去继承父类的属性,以及方法
在上述例子我们也看到了指定的子类特有的方法直接指定,那么我们如何指定子类特有的属性呢?...}
let tang = new byd()
console.log(tang)
在子类中需要知道子类特有方法需要在constructor中使用super(),super指向到父级类的原型区域...,只有使用super()才可以声明this,否则报错,需要继承父类的方法,只需要使用super的方法就行,super.tool表示继承父类的tool方法!...super就是指向父类原型