check window resize javascript
snippet in javascript

js window resize listener

user941

//listen for window resize event
window.addEventListener('resize', function(event){
    var newWidth = window.innerWidth;
    var newHeight = window.innerHeight; 
});

check window resize javascript

user7890

window.addEventListener("resize", () => {
		// CODE
});

js windowresize event

user2463

<p>Resize the browser window to fire the <code>resize</code> event.</p>
<p>Window height: <span id="height"></span></p>
<p>Window width: <span id="width"></span></p>