看代码functionA(){this.init();}functintest(){console.log('test');}A.prototype.init=function(){this.test=test.bind(this)//看这里this.prototype.test=test(this)//还是这里}看上面代码中我标记的地方,我想动态绑定一个外部函数作为A对象的方法,init方法里的this是指functionA呢还是A.prototype?
慕斯王
呼唤远方
回首忆惘然
随时随地看视频慕课网APP
相关分类