In JavaScript we don't have access to this variable inside functions like setTimeout. There are normally two workarounds which are :
var self = this and then use selfWhich one is your favorite way? I use the 2nd format most of the times as it keeps the code clean. Is there any additional benefits of using the 1st format?
Kevin Wolf
Full Stack Developer
EcmaScript 6 arrow functions :)