SOURCE

var a = {
  x: 1,
  fn() {
    console.log('this.x is ', this.x)
  }
}

class Test {
  constructor() {
    this.a = {
      y: 9,
      z: 10
    }
    this.a = Object.assign(this.a, a)
  }
}

var test = new Test()
console 命令行工具 X clear

                    
>
console