私は自分のオブジェクトにこの関数を持っています:
var time = {
warps : 3,
warpCounter : 50,
warp : function(){
if (this.warps > 0){
this.warps--;
this.warpLoop = 50;
this.warpLoop();
}
},
warpLoop : function(){
setTimeout(function () {
this.increment();
if (warpCounter--){
this.warpLoop();
}else{
if(this.warps > 0){
htmlInteraction.enableButton('warp-button');
}
}
}, 100);
},
};
this.warpLoop()
別のメソッドから(を使用して)呼び出そうとすると、次のようになります。
Uncaught TypeError: Property 'warpLoop' of object #<Object> is not a function
どうしてこれなの?