Magic eight ball project doesnt work

My project doesnt work! I need help!
the code:
const userName = ‘’;
userName ? console.log(Hello, ${userName}!)
: console.log(‘Hello!’);
const userQuestion = ‘Will I have kids when I grow up?’;
const randomNumber = Math.floor(Math.random() * 8);
let eightBall = ‘’;
switch randomNumber {
case 0
eightBall = ‘It is certain’;
case 1
eightBall = ‘It is decidedly so’;
case 2
eightBall = ‘Reply hazy try again’;
case 3
eightBall = ‘Cannot predict now’;
case 4
eightBall = ‘Do not count on it’;
case 5
eightball = ‘My sources say no’;
case 6
eightball = ‘Outlook not so good’;
case 7
eightball = ‘Signs point to yes’;

The error message:
switch randomNumber {

SyntaxError: Unexpected identifier
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:75:12)
at internal/main/run_main_module.js:17:47

I have no idea what any of this means! Any help?

I had to take a sneakpeak at my exercise before writing an answer. I thought that it should be parentheses around randomNumber and when looking at the solution it is. You can try adding parentheses after switch and see if that helps.

You have a few syntactical inaccuracies. Here you can see how to use switch correctly, just to recap:

As was said above, there are brackets around (randomNumber) after the word switch, and colons after all cases are missing. It should be like this, for example: case 0:

(Hello, ${userName}!) also needs single quotes inside. Sorry, I don’t know exactly what they are called in English :sweat_smile:
It goes like this: ('Hello, ${userName}!')

Thanks! It worked perfectly! Although I did not have to use single quotes!