Moon phases problem


#1


https://www.codecademy.com/en/courses/learn-javascript/lessons/control-flow/exercises/else-if


This is the error message that popped up. I tried changing moonphase to "mostly new", and the code worked, but the error message still popped up

Did you write an else if statement for if the moonPhase is mostly new?


var moonphase="full";
if (moonphase==="full") {
  console.log("Howwwwlll!!");
} else if (moonphase==="full") {
  console.log("I swear I am not a werewolf...");
} else if (moonphase==="mostly full"){
  console.log("Arms and legs are getting hairier.");
} else if (moonphase==="mostly new") {
  console.log("Back on two feet");
} else {
  console.log("Invalid moon phase");
}


#2

Check your spelling. JavaScript is case sensitive.


#3

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