Can I get some help with the eightball project?

I’ve been scrolling through this for about an hour and can’t seem to understand the problem. Anyone know why it doesn’t log the answer?

let userName = ''

userName ? console.log(`Hello, ${userName}!`)

: console.log('Hello!');

let userQuestion = ''

console.log(`${userName} asked: ${userQuestion}`);

const 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 eight ball answered: ${eightBall}`);

}

Hi,

your console.log is still within the switch statement and unreachable after the break. Just move it out of the scope.