SOURCE

class Color {
  constructor(color) {
    this.color = color
  }
  getColor() {
    console.log(this.color) return this.color
  }
}
class Rainbow extends Color {
  constructor() {
    super('red')
  }
}
new Rainbow()
console 命令行工具 X clear

                    
>
console