Have following code.
object.waypoint=function () {
this.uw=setInterval( function() {
console.log(this);
}, 200);
}
How do I refer to “object” inside function on line three, I tried it with “this” keyword but it doesn’t seem to refer the object.
Inside setInterval
thisrefers to window. You’ll need to make a variable that references tothis.