提示:原生的 call
与 apply
只有在参数处理方面有差异,因此这里直接调用了 apply 的实现
Function.prototype.call3 = Function.prototype.call || function (that) {
const args = []
for (let i = 0; i < arguments.length; i++) {
args[i] = arguments[i]
}
return this.apply3(that, args)
}