Avatar ·

How to get the size of the screen, browser window, and the web page itself in JavaScript?

Hello everyone! I'm a beginner in JavaScript and I'm making a responsive website. I need some elements to adapt to the user's device size. But I'm confused about the terms: what is screen, window, and document? And how do I get their exact sizes? For example, I wrote this code: ```javascript console.log('screen width:', screen.width); console.log('window inner width:', window.innerWidth); console.log('document width:', document.width); ``` But `document.width` returns `undefined`, and `screen.width` seems to show something I don't expect. I have a laptop with a Full HD screen (1920×1080), but `screen.width` gives 1536, and `window.innerWidth` gives 1519 (when the window is maximized). Why is that? And how do I correctly get the width and height of the web page itself (including scroll)? I want to understand th