Syntax error explanation needed
Hey guys! I need help please! Why doesn’t the code below have a syntax error but if > is replaced by >= it will show a syntax error? Thanks!!
let hungerLevel = 7;

if (hungerLevel > 7) {console.log(‘Time to eat’);}

else {console.log(‘We can eat later!’);};

It is producing a syntax error because you are using as your quotes when you are supposed to use ' or "

They are smart quotes if you copy them from a post. It’s not what the learner used, if you look closely. Discourse did that when you copied it.

A syntax error, or an SCT refusal to accept the code? What is the error message, and where is it displayed?

Thank you vey much, Ethan!!

Thank you very much, mtf!!

1 Like

same problem solved , thank you :smiley:

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