some friends help me to write the following code to reload page once time after 1 sec but it had syntax error where i did not know.can any one help me to edit?
window.addEventListener('load', () => {
if(!window.localStorage.getItem("reload")) setTimeout(() => {
window.localStorage.setItem("reload", "true");
window.location.reload();
}, 1000)
});
window.addEventListener('unload',()=>{
window.localStorage.removeItem("reload");
})
Thanks