输出的为什么是 window, 感觉绕几下就给自己绕蒙了
来源:4-3 this
王鹳厶
2020-04-06
const obj1 = {
test(callback) {
callback();
}
}
const obj2 = {
sayThis() {
console.log(this);
}
}
obj1.test(obj2.sayThis) //双越老师好, 请问输出的为什么是 window
写回答
1回答
-
拆开来写,应该就能看明白了
const fn = obj2.sayThis obj1.teste(fn)
042020-04-08
相似问题