Tell us what’s happening:
review the code and answer the appropriate answer. the code run correctly but could not meet the requirements suggested by the website.
Your code so far
const fortune1="Your cat will look very cuddly today.";
const fortune2="The weather will be nice tomorrow.";
const fortune3="Be cautious of your new neighbours.";
const fortune4="You will find a new hobby soon.";
const fortune5="It would be wise to avoid the color red today.";
let randomNum=Math.floor(Math.random()*5)+1;
console.log(randomNum);
function fortune()
{let selectFortune;
if(randomNum===1){
selectFortune=fortune1;
}
else if(randomNum===2){
selectFortune=fortune2;
}
else if(randomNum===3){
selectFortune=fortune3;
}
else if(randomNum===4){
selectFortune=fortune4;
}
else{
selectFortune=fortune5;
}
console.log(selectFortune)
}
fortune();
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Challenge Information:
Build a Fortune Teller - Build a Fortune Teller