Function.prototype.myBind=function(obj){if(typeofthis!=="function"){//this 指向调用obj的函数thrownewTypeError("not a function")}const that =thisconst args =Array.prototype.slice.call(arguments,1)returnfunctionfn1(){if(this instancof fn1){returnnewthat(...args,...arguments)}else{returnthat.apply(fn,args.concat(...arguments))}}