Function.prototype.bind=function(that, rest){
const outterThis = this;
return function(){
const innerThis = outterThis;
Array.prototype.splice.call(arguments, 0, rest.length, ...rest)
innerThis.apply(that, arguments)
}
}
Function.prototype.bind=function(that, rest){
return (...argu)=>{
argu.splice(0, rest.length, ...rest)
this.apply(that, argu)
}
}
网友评论