Whats wrong with my code? Control Flow - Switch Statements


The second instruction tells me to establish each "else if" condition as a case, which I believe I've done below. What do you guys think is incorrect with my code, as the lesson is telling me I've done something incorrectly?

Here are the instructions...

"Then, write each else if condition as a case.

If moonPhase is 'full', then use console.log to print 'Howwwwlll!!'.

If moonPhase is 'mostly full', then use console.log to print 'Arms and legs are getting hairier'.

If moonPhase is 'mostly new', then use console.log to print 'Back on two feet'.

Remember to add a break after each console.log, like in the example in the instructions."

var moonPhase = 'full';

switch (moonPhase) {
  case 'full':
  case 'mostly full':
    console.log('Arms and legs are getting hairier');
  case 'mostly new' :
    console.log('Back on two feet');
    console.log('Invalid moon phase');


What does it say you're doing wrong?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.