Use Conditional Logic with If Statements solution not passing

What might be wrong with my solution ?

Create an if statement inside the function to return Yes, that was true if the parameter wasThatTrue is true and return No, that was false otherwise.

My Solution:

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

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

Looking at your code, you are REALLY close!!

Your logic is correct. The strings you are returning are a bit off. The tests expect you to match the result exactly.

Thank soo much Naomi for the timely response. I have realize the commas after the Yes and No were missing and also the uppercase “T” in the “No” string were the cause. It passed after fixing them.

1 Like

Please how can i highlight please?

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