Window
The global object in a browser page, representing the browser tab, which holds globals such as document, location, setTimeout and fetch.
In more detail
Event propagation starts and ends at window. Web Workers have no window; their global object is self.
Related terms
- document object — The global object that represents the loaded page and is the root of the DOM tree, with methods such as querySelector and createElement.
- event propagation — The journey of an event through the DOM: down from the window to the target (capturing), at the target, then back up (bubbling).
- Web Worker — A script that runs on its own background thread, separate from the page's main thread, so heavy computation does not freeze the page.
- global augmentation — Adding types to global objects such as Window or NodeJS.ProcessEnv with a declare global { } block inside a module.
- lib (compiler option) — The compiler option that lists which built-in type declarations are available, such as ES2022 features or browser DOM types.
Taught in
- Event Phases: Capturing, Target And Bubbling Demystified — Frontend Architecture & Web Platform
- Passive Listeners, Scroll Performance And Touch Interactions — Frontend Architecture & Web Platform
- Web Workers: Off-Thread Computation And Structured Clone — Frontend Architecture & Web Platform
- Declaration Files, Ambient Namespaces And Module Augmentation — Production TypeScript