javascript – What is it and what are the differences between DOM, Window and Screen?

Question:

I read some definitions of these objects and in my understanding window is the first thing the browser loads and the DOM object is contained in it, the DOM being the representation of HTML .

But I still don't feel confident enough to talk about these objects properly, could you help me to define them more precisely?

Answer:

In a simple approach, window is a DOM window object, a global property that provides methods referring to the model's root, 'so window', it's inside that the DOM .

window MDN

screen is one of the methods that window provides, basically it stores information about the dimensions of the window.

window.screen MDN

DOM is a long subject and has already been covered here.

Scroll to Top