修改this 指向
2021-05-08 本文已影响0人
小呆糊总
题目描述:
封装函数 f,使 f 的 this 指向指定的对象
function bindThis(f, oTarget) {
return function(){
return f.apply(oTarget,arguments);
}
}
封装函数 f,使 f 的 this 指向指定的对象
function bindThis(f, oTarget) {
return function(){
return f.apply(oTarget,arguments);
}
}