7/11 first question


#1

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

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

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')
     console.log('ERROR')


#2

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

Invalid moon phase is what you should log to the console


#4

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

^^^ it keep saying this


#5

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


#6

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 ? ?


#7

we have the following condition:

if full
else if mostly full
else if mostly new
else

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


#8

thanks i got the answer already


#9