How to get the global object window

1. window.self

window.self === window; // true

 

2. Use window.window

window.window === window; // true

 

3. Use window.globalThis

window.globalThis === window; // true

 

4. Using this global environment directly

this === window; // true

 

5. Use window.frames

window.frames === window; // true

 

6. Use window.top

window.top === window; // true

 

7. In page frame without window.parent window may be used;

window.parent === window; // true

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11702812.html