7/11 first question

<Below this line, add a link to the EXACT exercise that you are stuck at.>


guys i need help, i don’t know what i did wrong

let moonPhase = '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(moonPhase === 'Invalid moon phase')

else can’t have a condition, since its everything else

Invalid moon phase is what you should log to the console


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

^^^ it keep saying this

you need a second else if statement as well to check the moon is mostly full


this is the code

let moonPhase = '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 if(moonPhase === ‘Invalid moon phase’)
console.log(‘Invalid moon phase’)

where do i need to put a else if Statement ? ?

we have the following condition:

if full
else if mostly full
else if mostly new

one if condition, two else if condition, then an else (without condition) to log invalid moonphase to the console


thanks i got the answer already