手写 Function.prototype.call:
Function.prototype.myCall = function (context, ...args) {
context = context || window;
const fn = Symbol('fn');
context[fn] = this;
const result = context[fn](...args);
delete context[fn];
return result;
}
标签:原生,Function,const,函数,...,context,手写,fn
From: https://www.cnblogs.com/mxyulin/p/17408142.html