Logical Operators Instructions 2 Bug or Mistake?


#1

I’m having trouble getting past step 2 and I believe I have everything right. I reported the bug but I can’t move on until this is fixed. Can someone look at my code to make sure I’m not just making a mistake?


#2

Set moonPhase to 'full', not to ('full')


#3

Did that and it worked. Thank you. It’s weird because I’ve had parenthesis in all exercises before this and that worked but now it doesn’t like that. Weird. Thank you again.


#4

Hi @masskiller5225,

The usual coding practice, you don’t need parenthesis to assign values to variables.

Parenthesis is often used for grouping purpose (ie: math operation) or when is used for syntax purposes to wrap around conditions such as for loop, if/else, while statements and etc.

When assigning values to variable, no parenthesis is needed:

//string value
let test1 = "Apple";

//number value
let test2 = 2;

//boolean value
let test3 = true;

Therefore, be vigilant when learning to code by your own, read the examples and instructions carefully, refer documentations even when you don’t need it. Below is a good source:

I don’t remember Codecademy lessons that ask you to insert parenthesis when assigning value to a variable. It must be an error you pick up along the way and the mistakes were overlooked by the Submission Test. Sometimes, you just can’t rely wholly on the Submission Test. Just like your encounter this time, you wouldn’t know about this if the lesson is letting you pass through again. Double check and triple confirm with another external source when self-learning, that would further cement your knowledge for a better foundation.

Just my thoughts. Happy learning! Cheers :slight_smile:


#5

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