if (moonPhase === ‘full’) {
console.log(‘Howl!’);
} else 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’);
}
As your code still works because the condition is checking whether moonPhase is 'full', and it is, so it printed 'Howl'. Thus, you’re wondering why the error? But the lesson is throwing error because it is checking your full code, and there is one error there.
Just a Hint for you to debug your code:
You have only one mistake in your full code, but that one mistake means a lot in coding, try check from this perspective, include every spellings and case-wise. I can just tell you where it is, but it is better if you can find it yourself. Then you will sharpen your skill of debugging. It’s another skill you will depend a lot while learning to code.
Side Note:
If you have any question in future, it is best to post a link towards the lesson, state what error it throws and use proper markdown to format your code in your post (use the </> icon to wrap your code), refer more here
With that, I hope you can find that one error, come back again if you really hit the road block.
Maybe try adding a semicolon at the end.
Also, if you do not get the console.log wording exactly correct, sometimes they will nag you about it. Hope I help.
@ionatan , could you possibly help? You’re very good at this.