Build a Fortune Teller

const fortune1="Your cat will look very cuddly today.";
const fortune2="The weather will be nice tomorrow.";
const fortune3="Be cautious of your new neighbors.";
const fortune4="You will find a new hobby soon.";
const fortune5="It would be wise to avoid the color red today.";
const randomNumber=Math.floor(Math.random()*(5-1)+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);

I seem to have an issue with step 9. The randomNumber should correspond to its fortune. For example, if randomNumber is 1, the selectedFortune should be equal to fortune1 and so on.

even though in my console the results seem to be correct.

Link for the lab.

Welcome to the forum @tziompanou !

User story:

  1. You should create a selectedFortune variable and assign the appropriate fortune (…)

let selectedFortune = randomNumber; - this code gives this variable a number, not a fortune syntax.
You using console.log(fortune#) as a result, while the user story 3. asks you otherwise.

How can you do that?

You may also want to take a closer look at this code. Will your random numbers be 1, 2, 3, 4, or 5?

Math.random() - JavaScript | MDN

Thank you so much for your response! Yes, I need to have one of these random numbers.