es6类的继承
程序员文章站
2022-07-13 09:33:09
...
1、es6类的继承:
class Father{
constructor(){
this.xx = "A";
this.dna = "染色体";
}
}
class Child extends Father{
constructor (){
super();
this.name = "euanxiaohua"
this.age = 18
}
}
const child = new Child()
console.log(child)
上一篇: ES6对象的super关键字
下一篇: ES6对象新增方法