tezvyn:

The `window` Object: Your Browser's Global Scope

Source: developer.mozilla.orgbeginner

Think of the `window` object as the global stage for your JavaScript. It represents the browser tab and holds all global variables and APIs like `fetch` and `setTimeout`. You use it constantly, often implicitly.

The `window` object is the global execution context for JavaScript in a browser. Think of it as the top-level object for the browser tab, containing the DOM document and all global variables, functions, and built-in APIs like `fetch` and `localStorage`. You use it implicitly when calling global functions and explicitly for browser-level tasks like checking `window.innerWidth`. The biggest footgun is polluting the global scope with your own variables, which risks name collisions with other scripts or future browser APIs.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

The `window` Object: Your Browser's Global Scope · Tezvyn