JS AddEventListener ke lebar jendela

const removetogglenav = ()=>{
    if(window.innerWidth > 780){
        console.log(window.innerWidth);
    }
}

window.addEventListener('resize', removetogglenav);
Strange Snake