How to find width of screen in JavaScript?
innerWidth to get the width of the device screen. The innerWidth property is used to return the width of the device.
How do I find my screen width and height?
If you have the screens diagonal, you can multiply that measurement by 0.872 to get the screen's width. You can also multiply the diagonal by 0.49 to get the screen's height. Then, if you wish to find the screen area, multiply the width by the height.