// 第一版: 返回一个函数 函数返回结果
Function.prototype.bindByTxd = function (context){
let self = this
return function (){
return self.apply(context)
}
}
// 第二版: 接受参数
Function.prototype.bindByTxd = function (context){
let self = this
// 获取bindByTxd函数第二个之后的参数
let args = Array.prototype.slice.call
自己实现一个Bind函数
最新推荐文章于 2023-09-12 15:18:57 发布