2
05/11/2024 3:41 अपराह्न
विषय प्रारंभकर्ता
I need to create code in JavaScript called: Annoy-O-Matic;
It should say in browser with alert: "Are we there yet?" and the user must say "yes" or "yeah" in order to alert the user: "YAY, we've made it!" - if not - it must repeat the question!
1 उत्तर
2
05/11/2024 3:42 अपराह्न
You can use this code, my friend:
var answer = prompt("Are we there yet?");
while (answer !== "yes" && answer !== "yeah") {
var answer = prompt("Are we there yet?");
}
alert("YAY, we've made it!");
