Getting an error in correct code


I am getting an error saying "Did you write an else statement that logs 'Invalid moon phase'?
", even though I have that statement.

var moonPhase = 'full';

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


You could try refreshing your browser.

Else, copy your code, reset the exercise and paste it back.


I have tried doing both these things.


Then perhaps try using another browser for this exercise?


Mine works. As we only indicate one var for the moon full I think we do not need three equals.

/*var moonPhase = ('full');
} else {
console.log('I swear I am not a werewolf...');
} *


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