JSFiddle - React, Tailwind, and code Playground
by Nicolas PUJOL
JavaScript
var user = prompt("What's this question about?").toUpperCase();
switch (user) {
case "potato":
console.log("great");
var q1 = prompt("YES?").toUpperCase();
var q2 = prompt("YES?").toUpperCase();
if (q1 === "YES" && q2 === "potato") {
console.log("fantastico");
}
break;
case "what":
console.log("excellent");
var q3 = prompt("NO?").toUpperCase();
if (q3 === "NO" || q3 === "what") {
console.log("preposterous");
break;
case "huh":
console.log("thought so...");
break;
default:
console.log("oh okay");
}