js中,类的继承

创建类:
class student{
    constructor(name,age){
        this.name=name;
        this.age=age;
    }
    learn(){
        console.log('我是学生');
    }
}
类的继承:
class child extends Student{
    constructor(name,age){
        super (name,age);
    }
    coolings(){
        console.log('cooling');
    }
}

原文地址:https://www.cnblogs.com/baichuan147258/p/7296370.html