Encountered a problem and looking for help!


#1

Hey guys https://www.codecademy.com/courses/learn-javascript/projects/magic-eight-ball

If someone can identify what is going wrong with my code that it doesn’t run for some reason…

let userName = ‘Jose’;
userName ? console.log(Hello, ${userName}!) : console.log(‘Hello!’);

let userQuestion = ‘Will I be reach in the future?’;
console.log(The user asked: ${userQuestion}?);

let randomNumber = Math.floor(Math.random() * 8);

let eightBall = ‘’;

switch(randomNumber){
case = 0:
eightBall = ‘It is certain’;
break;
case = 1:
eightBall = ‘It is decidedly so’;
break;
case = 2:
eightBall = ‘Reply hazy try again’;
break;
case = 3:
eightBall = ‘Cannot predict now’;
break;
case = 4:
eightBall = ‘Do not count on it’;
break;
case = 5:
eightBall = ‘My sources say no’;
break;
case = 6:
eightBall = ‘Outlook not so good’;
break;
case = 7:
eightBall = ‘Signs point to yes’;
break;
}
console.log(The eightBall answered: ${eightBall});

Seems like problem with case statements but not sure…

Would appreciate any help!


#2

case is a state, not a variable.

case 0:

case 1:

&c.

#3

Just found it out too… lol was trying almost everything besides it… thanks mtf!!