Function.prototype.myCall = function (obj,...rest){
obj = obj ? Object(obj) : window;
const fn = Symbol("test");
obj[fn] = this;
const res = obj[fn](...rest)
delete obj[fn]
return res;
}
let obj = {name:"小米汽车"}
function add(){
console.log(this.name)
}
add.myCall(obj)