This is the code I have written so far.
<!DOCTYPE html>
<html>
<body>
<script>
{
let hourNow = prompt("please enter the hour based on 24hr clock");
var greeting;
if(hourNow = 6 && hourNow<=9){
greeting = 'Brreakfast is served.';
} else if (hourNow >= 11 && hourNow <=13){
greeting = 'Time for lunch.';
} else if (hourNow = 17 && hourNow >=20){
greeting = 'Time for dinner';
}else{
greeting = 'You will have to wait or get a snack'
}
}
document.write('<h3>' + greeting + '</h3>');
</script>
</body>
</html>
The code works and it doesn't work It seems to work ok for breakfast if you input 9. All other hours it is saying sorry you have to wait or get a snack.