const heightOutput = document.querySelector('#height');
const widthOutput = document.querySelector('#width');
function reportWindowSize() {
heightOutput.textContent = window.innerHeight;
widthOutput.textContent = window.innerWidth;
}
window.onresize = reportWindowSize;
why not
window.onresize = reportWindowSize()
?
it's function call, I want to trigger it. but when I add the () it's not working.