// 重写内置call方法
Function.prototype._call = function _call(context, ...params) {
// this->fn context->obj params->[10,20]
// context是undefined或者null的情况
if (context == null) context = window;
// context是传的是原始值得情况
if (!/^(object|function)$/i.test(typeof context)
手写call以及apply方法(完整版包含格式校验)
最新推荐文章于 2022-10-26 15:05:46 发布