Currently need help with Use Conditional Logic with If Statements

Tell us what’s happening:
I don’t understand why it keeps saying syntax error, can someone check my mistake…I’ve been going back and fort and I can’t seem to figure out the problem…
Your code so far

function trueOrFalse(wasThatTrue) {
// Only change code below this line
if (wasThatTrue) {
return "Yes, that was true";
} else 
return "No, that was false";
// Only change code above this line


  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36.

Challenge: Use Conditional Logic with If Statements

Link to the challenge:

Quick hint, you’re missing a bracket.

Try counting how many open brackets you have and how many closed, and see if you can find what needs to be added.

Typically if you were using an IDE, this shouldn’t be a big issue since it’ll let you know what’s wrong automatically, but the online code editor on freeCodeCamp isn’t smart enough for that, unfortunately.

If you’re still stuck, don’t be afraid to drop another comment.

oh yes I was missing this “{” bracket :sweat_smile: thank you

1 Like