check if window has been resize code example
Example 1: check window resize javascript
window.addEventListener("resize", () => {
// CODE
});
Example 2: js detect screen size change
window.onresize = function(){
console.log("resize");
}
window.addEventListener("resize", () => {
// CODE
});
window.onresize = function(){
console.log("resize");
}