console.log('weekend'); if(hours >= 0 && hours < 24){ console.log('breakfast'); window.location.href = "/breakfast-menu"; } } even if(day == 0){ console.log('weekend'); if(hours >= 0 && hours < 6){ console.log('night'); window.location.href = "/night-menu"; } if(hours >= 6 && hours < 15){ console.log('breakfast'); window.location.href = "/breakfast-menu"; } if(hours >= 15 && hours < 24){ console.log('night'); window.location.href = "/night-menu"; } } else{ console.log('workday'); if(hours >= 0 && hours < 24){ console.log('night'); window.location.href = "/night-menu"; } }