I have tried this several times ever since we received it as a question in my Programming course, and everything works well, apart from the time aspect. How does one solve this?
var card = prompt("Do you have your card?")
var hour = 24
switch (card) {
case "Yes":
if (new Date().getHours() < 16) {
console.log("You are allowed in")
} else {
console.log("You are not allowed in")
}
break
case "No":
console.log("You are not allowed in")
break
}
Aucun commentaire:
Enregistrer un commentaire