Is the hint incorrect, or my code?


#1

The hint has an open curly bracket after the else if conditional. My code does not, yet it still passes as good. When I add the curly bracket, the code errors out.


#2

Here's the hint:


#3

I could be incorrect as I'm still a beginner myself, but I believe that
else {
return "paper wins";
}
should not have curly brackets, as else statements do not take conditions. The code is running because ( I think) the last } bracket is closing the entire compare function. I could be completely incorrect though.


#4

say that to the "hint" the codecademy provides :slight_smile:

I'd like to contact codecademy directly but there is not indication on
their website on how to contact them . . .


#5

I'm going to risk being told I'm leading the discussion off-topic but I think this link might clarify some issues with curly braces.


#6

thanks for sending this over. very much on topic. My primary concern is
relying on a program that teaches programming that either isn't programmed
properly or not teaching properly by not providing all pertinent info . . .

thanks again for sending this over!


#7

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