Else if error( Did you write an else statement that logs 'Invalid moon phase'?)

My code:

let moonPhase=“nofull”;
if(moonPhase===“full”)
{
console.log(“Howl!”);
}
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”);
}

any help???

Yes, link to the exercise please.

We need to be able to see what’s precisely being asked.

https://www.codecademy.com/courses/learn-javascript-control-flow/lessons/control-flow/exercises/else-if?action=lesson_resume&course_redirect=introduction-to-javascript

When copy/pasting your code, the quotation marks that you use don’t recognize the strings.

Yours appear like this: “ Howl! ”
When they should appear like this: " Howl! "

Once I changed that everything worked fine. What kind of keyboard are you using (country)?

Edit: My bad, it doesn’t work fine. You need to structure your code.

if (condition) {
  console.log(something);
}
else if (other condition) {
  console.log(something);
}
else {
  console.log(something);
}

i m currently using a dell laptop.

Anyway, the underlying problem here is the structure of the code, as per my example.

Did you get it to work?

No its not working!!!

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