SOURCE

class Parent {
    constructor(name, age) {
        this.name = name;
        this.age = age;
    }
    say() {
        console.log(this.name);
        console.log(this.age);
    }
    play() {
        console.log("Prent play");
    }
}

class Child extends Parent{
    constructor(name, age) {
        super(name, age);
    }
    play() {
        console.log("Child play");
    }
}

let child = new Child("fs", 15);
child.say();
child.play();
console 命令行工具 X clear

                    
>
console