What is the correct way for this code?



This warning is being shown: Did you write an else if statement for if the moonPhase is mostly full?

var moonPhase = 'mostly full';

 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');


You didn't include a part to check for if moonPhase === 'full'. Here is the code that the hint provides:

if (moonPhase === 'full') {

} else if (moonPhase === 'mostly full') {

} else if (moonPhase === 'mostly new') {

} else {


You just need to put the moonPhase vardeclaration at the top, and put theconsole.log() statements in place.


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