When I run the program, the console gives me an error that "Sunday" (and "Saturday", based on the user input) does not exist. I have tried many combinations in the if statement with the parentheses and nothing worked.
var day = prompt("Enter a day of the week.");
console.log("Day is: " + day);
//if user input is equal to Sunday OR user input is equal to Saturday,
if (getText(day) == "Sunday" || getText(day) == "Saturday") {
console.log("It's the weekend!");
} else {
console.log("Can't wait for the weekend to get here.");
}
Aucun commentaire:
Enregistrer un commentaire