JSFiddle - React, Tailwind, and code Playground

by Mamdouh Freelancer

JavaScript

var ask = prompt("Do you like apples?");
if (ask == "yes") {
  alert("I like too");
  //do whatever
} else if (ask == "no") {
  alert("Why apple is delicious fruit");
  //do whatever
} else {
  //invalid answer prompt again
  ask = prompt("Do you like apples?");
}