I am stuck in the if/else portion. Not sure if I am typing this correctly?
var moonPhase = ‘full’;
if (moonPhase = ‘full’); {
console.log(‘Howwwwlll!!’); }
else if (moonPhase);
console.log(‘I swear I am not a werewolf…’)
}
@zaynberger from a quick glance I can see that you are missing some syntax
if (condition1) {
block of code to be executed if condition1 is true
} else {
block of code to be executed if the condition1 is false
}
Also the right advice or code review, isnt always this easy or quick, for future reference, share the lesson name, the webpage link, the step you are struggling on, also the code you tried and sometimes the error message that pops up.
All of this information is really helpful for you to mull over and it introduces us to the problem so we can point you in the right direction in a timely manner
@zaynberger Hi, You should to re-read Control Flow, lesson 4. Comparisons Operators II. You put only one equal sign in your if statement, and since you’re comparing whether or not moonPhase is equal to full, you want to use === instead of =. Your var statement is correct because you are only assigning a value to moonPhase.
You want to take out the semicolons on the if and else if lines:
if (moonPhase = ‘full’); {
and
else if (moonPhase);
with if and else if statements you put them at the end of the statement, right before the closing curly brace;
console.log(‘Howwwwlll!!’); } is correct
and you need to put a semicolon at the end of;
console.log(‘I swear I am not a werewolf…’)
Also, you want to put an open curly brace at the end of your else if line .
else if(moonPhase).