When I execute myCallback through setTimeout. How is this
evaluated inside myCallback ?
setTimeout(myCallback, 1000);
// is 'this' inside myCallback going to be the same as
// if I invoked myCallback directly like this: myCallback() ?
When I execute myCallback through setTimeout. How is this
evaluated inside myCallback ?
setTimeout(myCallback, 1000);
// is 'this' inside myCallback going to be the same as
// if I invoked myCallback directly like this: myCallback() ?
myCallback function will be invoked in a new scope, so "this" from the current object wont be available anymore and instead, "this" will refer to the global "window" object