The Browser Object Model contains objects that represent the current browser window or tab. The topmost object in the BOM is the window object representing the window or tab or an iframe sometimes.
Window object has properties like browser history, location and the device’s screen etc. In case of multi tab browser, a window object represents a single tab, but some of its properties like innerHeight, innerWidth and methods like resizeTo() will affect the whole browser window.
The document object represents the whole html document.
When html document is loaded in the browser, it becomes a document object. It is the root element that represents the html document. It has properties and methods. By the help of document object, we can add dynamic content to our web page.
--->window object represents the browser window itself and provides methods for interacting with the browser's environment,while document object represents the current web page's content and structure, allowing manipulation using the DOM.
--->Document represents any HTML document or web page that is loaded in the browser,while Window represents a browser window or frame that displays the contents of the webpage.
--->Document object is loaded inside the window,while window is the very first object that is loaded in the browser.
--->All the tags, elements with attributes in HTML are part of the document,while Global objects, functions, and variables of JavaScript are members of the window object.
--->Document is part of BOM (browser object model) and dom (Document object model),while the window is part of BOM, not DOM.
--->Properties of document objects such as title, body, cookies, etc can also be accessed by a window like this window. document.title,while the Properties of the window object cannot be accessed by the document object.