When I try and run the add function it gives TypeError: this.add is not a function
function Timer(){
this.t;
this.count = 0;
this.start = function(){
this.t = setInterval(function () {this.add()}, 1000);
}
this.add = function(){
this.count++;
console.log(this.count);
}
}
function startTimer(){
timer = new Timer();
timer.start();
}
How am I able to access this.add function in that instance?