Function.prototype.call = function(context = window, ...args) {
if (typeof this !== 'function') throw new TypeError();
context.fn = this;
let res = context.fn(...args);
delete context.fn;
return res;
}
js函数call实现
最新推荐文章于 2023-03-22 19:44:01 发布