get the size of the screen javascript 1

get the size of the screen javascript

window.screen.height;
window.screen.width;

Here is what the above code is Doing:
1. We’re creating a new variable called “window” and assigning it the value of the “window” object.
2. We’re creating a new variable called “screen” and assigning it the value of the “screen” property of the “window” object.
3. We’re creating a new variable called “height” and assigning it the value of the “height” property of the “screen” object.
4. We’re creating a new variable called “width” and assigning it the value of the “width” property of the “screen” object.

Similar Posts