SOURCE

class Person{
  constructor(name,age){
    this.name = name;
    this.age = age;
  }
  say(something){
    console.info("I'm "+this.name+", "+this.age+" years old.");
    console.info(something);
  }
}

class SuperMan extends Person{
  constructor(name,age,power){
    super(name,age);
    this.power = power;
  }
  fly(height){
    this.say("Hello, human beings!");
    console.info("I can fly to "+height+".");
  }
}

const zs = new Person("Zhang San",20);
zs.say("Hello");
const spider = new SuperMan("Spider Man",10,"save the earth");
spider.fly(100000);  
console 命令行工具 X clear

                    
>
console