SOURCE

//定义一个函数
function App(name){
  this.name = name;
  this.created();
}

//扩展原型
App.prototype={
  created:function(){
    console.log(this)
    console.log(`${this.name} has been created!`);
  },
  mounted:function(){
    console.log()
  },
  destory:function(reason){
    let re = reason || "";
    this.destory_time = new Date.getTime();
    console.log(`${this.name} has been destroyed at ${this.destory_time} for ${re}!`);
  }
}

let app = new App('app');
console.log(app.destroy(''));

let test = new Object();
test.apply(app,'')
console 命令行工具 X clear

                    
>
console