A common confusion in the javascript language occurs when using the alert and window.alert methods.

What is the difference between the ALERT and WINDOW.ALERT methods?

The WINDOW object has a global range in the reading.
All other objects that are associated with a reader window or HTML document are considered members of the WINDOW object.

In Javascript, WINDOW is the default object, so it is possible to access its properties and methods without specifying WINDOW in a variable or method.

For a web browser both lines of code are the same.

window.alert("Wellcome to me");
and
alert("Wellcome to me");

WINDOW object the same purpose even in this case:

window.document.getElementById("demo");
and
document.getElementById("demo");