I have an object:
function cat(){
this.timesSaid = 0
this.sayMeow = function(){
setTimeout(this.meow, 1000)
}
this.meow = function(){
this.timesSaid++;
alert("Meow!")
}
}
However, I keep getting this.timesSaid as undefined. I assume it has to do with me calling it via setTimeout.
How do i work around this problem?