Window object:
It’s the global object that represents the open window in the browser.
- All predefined methods like: alert(“hello”) are attached to the global window object.
alert("hello"); === window.alert("hello");
- All new global variables and methods are also attached to the global window object.
var name = "John";
console.log(name); //John
console.log(window.name); //John
- BOM…