This is a very complicated topic, but in the short version it uses == when comparing windows, not === , because of the "internal" and "external" reference aspects. You will find that (for example) window === self is false in some browsers.
Tj crowder
source share