There\'s a convoluted backstory involving how I came across this, but why is the self
property not exactly equal to the window itself?
In Safari and Fir
Nice question. It does it with document
and document.parentWindow
too:
window == document; // true
window === document; // false
window == document.parentWindow; // true
window === document.parentWindow; // false
The big wtf for me though is:
window == document; // true
document == window; // false
You can swap out window
with this
in any of the above examples (and stay in the global context) with the same results. It makes the ==
operator even more suspect.
Why it behaves this way is so beyond me.