Function.prototype.mybind = function (context, ...args) {
var _this = this
function F() {
args = args ? [...args, ...arguments] : [...arguments]
F.prototype.__proto__ = new _this(...args)
_this.apply(context, args)
}
return F
}
bind方法实现
最新推荐文章于 2024-03-15 17:58:54 发布