Tell us what’s happening:
i already followed the answer on forum but still get wrong at the if else condition
Your code so far
let fortune1 = "Your cat will look very cuddly today.";
let fortune2 = "The weather will be nice tomorrow."
let fortune3 = "Be cautious of your new neighbors.";
let fortune4 = "You will find a new hobby soon.";
let fortune5 = "It would be wise to avoid the color red today.";
let randomNumber = Math.floor(Math.random() * 5) + 1;
let selectedFortune = randomNumber;
if (randomNumber == 1) {
console.log(fortune1);
} else if (randomNumber == 2) {
console.log(fortune2);
} else if (randomNumber == 3) {
console.log(fortune3);
} else if (randomNumber == 4) {
console.log(fortune4);
} else if (randomNumber == 5) {
console.log(fortune5);
}
console.log(selectedFortune);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0
Challenge Information:
Build a Fortune Teller - Build a Fortune Teller