Window Object Properties Examples
Example 1: We will use the console property in this example to show how it works.
// This is console property
console.log(window.location)
Output:
Location {ancestorOrigins: DOMStringList, href: 'chrome://new-tab-page/', origin: 'chrome://new-tab-page', protocol: 'chrome:', host: 'new-tab-page', …}
Window Object in JavaScript
In JavaScript, the Window
object represents the window that contains a DOM document.
The Window
object provides access to various properties and methods that enable interaction with the browser environment, including manipulating the document, handling events, managing timers, displaying dialog boxes, and more.