JSFiddle - React, Tailwind, and code Playground
by tjnicolaides
JavaScript
var answer = ”0”; // wrong quote characters
while (answer != "4") {
answer = prompt("You! What is the value of 2 + 2?", "");
if (answer == ”4”) { // also wrong
alert("You must be a genius or something.");
break;
} else if (answer == "3" || answer == "5") {
alert("Almost!");
break;
} else {
alert("You're an embarrassment.");
}
}