js实现一个call
2019-10-16 本文已影响0人
LUGY
Function.prototype.$call = function(...args) {
let target = args[0];
target.fn = this;
let params = args.slice(1);
target.fn(...params);
delete target.fn
}
Function.prototype.$call = function(...args) {
let target = args[0];
target.fn = this;
let params = args.slice(1);
target.fn(...params);
delete target.fn
}