Build a Fortune Teller - Step 9

can someone help me with these problem

here is my problem

9. The randomNumber should correspond to its fortune. For example, if randomNumber is 1, the selectedFortune should be equal to fortune1 and so on.

here is my code

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 randomNum1 = Math.random();

const randomNumber = 2;

const selectedFortune = randomNumber;

if (randomNumber == 1) {

selectedFortune === fortune1

} else if (randomNumber === 2) {

selectedFortune === fortune2

} else if (randomNumber === 3) {

selectedFortune === fortune3

} else if (randomNumber === 4) {

selectedFortune === fortune4

} else if (randomNumber === 5) {

selectedFortune === fortune5

};

console.log(selectedFortune);

This is not random

1 Like

but it can work tho
then how about that step 9? i got confused really hard :confused:

you need to create randomNumber randomly, or it’s not going to pass

I don’t know what that is, please post a link to the challenge

It can’t pass the tests if the number is not actually random