- The
window object is the global object representing the browser's window or tab.
- It provides methods, properties & events to interact with the browser environment.
- Everything in Javascript, like functions, variables, and even the document itself, are properties of the window object by default.
- It's implicitly referenced, meaning you can access global properties like
alert() or document without using window. prefix.
Example
window.alert() shows an alert box
window.location gives access to the URL of the current page.