I have a function that tells what the current width of the user's screen is but when i resize window to width less than 1024 that function doesnt output width less than 1024
function xxx(){
var x = window.screen.Width
console.log(x)
}
setInterval(xxx, 1000)
output:
1024
even if screen width less than 1024 how can i fix this without using @media requests?
already tried:
window.screen.innerwidth