Function.prototype.myCall = function(_this){
//第一步
var _this = _this || window
_this.fn = this
// 第二步
let arr=[]
for(let i=1;i<arguments.length;i++){
arr.push(arguments[i])
}
var result = _this.fn(...arr)
// 第三步
delete _this.fn
return result
}
function foo(age,sex){
console.log(age,sex,this.name)
}
let pro = {
name:'kai'
}
foo.myCall(pro,'18','man')