Re:“This” in JavaScript
by zenojevski on Monday December 08, 2014 @04:26AM
(#8715631)
The way you've written this code, `this` refers to `o`, as it has been evaluated at the time of execution of `f()` (first case) rather than inside the `setTimeout` callback, at which point it'd be `Window` (second case). So yes.
Basically your code is doing this right now:
If you did this: Then it'd be `Window` as in rule #2.