get screen size in js code example
Example 1: get window size javascript
const window {
width: window.innerWidth,
height: window.innerHeight
}
Example 2: get screen width javascript
window.screen.width
//or just
screen.width
Example 3: js detect screen size change
window.onresize = function(){
console.log("resize");
}
Example 4: js know size of screen
alert("Your screen resolution is: " + screen.width + "x" + screen.height)