Tell us what’s happening:
I am not sure what is wrong here, I put the if then statement and it then tells me that everything I am missing everything needed to pass the lab.
Your code so far
const fortune1 = "You will be happy";
const fortune2 = "You will be sad";
const fortune3 = "You will be hangry";
const fortune4 = "You will be mad";
const fortune5 = "You should stay in tomorrow";
const min = 1;
const max = 5;
const randomNumber = Math.floor(Math.random() * (max - min) + min);
if (randomNumber === 1) {
const selectedFortune = fortune1;
} else if (randomNumber === 2) {
const selectedFortune = fortune2;
} else if (randomNumber === 3) {
const selectedFortune = fortune3;
} else if (randomNumber === 4) {
const selectedFortune = fortune4;
} else {
const selectedFortune = fortune5;
}
console.log(selectedFortune);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0
Challenge Information:
Build a Fortune Teller - Build a Fortune Teller