What is the difference between window and this.window, in javascript?
javascript
Solution
"Is there ever a situation where `window !== this.window; //true`"
Sure, whenever `this` refers to an object without a `.window` property or with a `.window` property that doesn't point to the global object (assuming a browser environment where `window` is the global).
"...when would you ever write `this.window` instead of straight out `window`?
When `this` refers to an object where a `.window` property is anticipated not being a reference to the global.
Problem
I'm looking at a complex bit of JavaScript, which is doing all sorts of runtime/dynamic manipulation of objects and scripts. In the process, I'm learning all sorts of minutiae about Javascript and its idiosyncrasies. This one has me stumped, though. Is there ever a situation where ``` window !== this.window; //true ``` In other words, when would you ever write this.window instead of straight out window?