Say I have an object:
var myObj = function {
this.count = 0;
}
myObj.prototype {
setCount : function() {
var interval = setInterval(function() {
this.count++;
}, 500);
}
}
The issue is count is always undefined within the setInterval so i can never increment the count variable within myObj to be something other than 0.