在下面的代码中,什么时候somethingUseful.thisUsefulThing
调用 from setTimeout
,可以引用somethingUseful.thatUsefulThing
吗?
var somethingUseful = {
thisUsefulThing: function() {
this.thatUsefulThing();
},
thatUsefulThing: function() {
console.log("I am useful!");
}
}
setTimeout(somethingUseful.thisUsefulThing, 1000);
现在,我收到此错误:
Uncaught TypeError: Object [object global] has no method 'thatUsefulThing'