settingsAccountsettings
By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy
Menusettings

Q: Annoy-O-Matic Task in JavaScript

+2 votes

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!

asked in JavaScript category by user eiorgert

1 Answer

+1 vote

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!");

 

answered by user hues
...