Function.prototype.myCall = function(obj,...arg) {
obj._fn_ = this;
obj._fn_(...arg);
delete obj._fn_;
}
let o ={
name : 'o',
fn: function() {
console.log(this.name,...arguments);
}
}
let test = {
name : 'test'
}
console.log(o.fn(1,2,3));
console.log(o.fn.call(test,1,2,3));
console.log(o.fn.myCall(test,[1,2,3]))