Difference between this and self in JavaScript
function Wilto() { var self = this; self.age = 32; setInterval( function constantBirthdays() { self.age++; console.log( "I am now " + self.age + " years old"); }, 3000 ); } Wilto();
function Wilto() { this.age = 32; setInterval(() => { this.age++; console.log( "I am now " + this.age + " years old"); }, 3000 ); } Wilto();