前端挑戰之js編程題(1)

題目要求:app 封裝函數 f ,使 f 的 this 指向指定的對象函數 思路:this 看到題目要求,首先應該想到js 中改變this 指向的三個方法 (bind , apply ,call),這樣就可以解決該問題了。spa 方案1:對象 function bindThis(f,oTarget){get return function (){io return f.apply(oTarget,
相關文章
相關標籤/搜索