Help with Magic Eight Ball project


Hello, it seems I am having a problem with this project. The console won't display the ball's answer.

var userQuestion = 'Will I ever become a programmer?';
var randomNumber = Math.floor(Math.random() * 7);
var 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 = 'Don\'t count on it';
  case '5':
    eightball = 'My sources say no';
  case '6':
    eightball = 'Outlook not so good';
  case '7':
    eightball = 'Signs point to yes';
console.log('The user asked: ' + userQuestion);
console.log('The eight ball answered: ' + eightBall);

The console only prints this out:

The user asked: Will I ever become a programmer?
The eight ball answered:

Is there a mistake in the code? Would greatly appreciate any advice.


javascript is case eightBall and eightball is not same.

and here

case '0':

'0' and 0 is not same.

'0' is string and 0 is number.Anything in quotation marks is string.

you need number not string


Thank you so much! Now it works just fine.