Basic JavaScript - Use Conditional Logic with If Statements

Tell us what’s happening:
It seems there might be a bug in the code as I’m checked for hints, and looked through the videos. However, for reason this doesn’t finish the final task " trueOrFalse(false) should return the string No, that was false"

Your code so far

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


  // Only change code above this line

}

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.0 Safari/605.1.15

Challenge: Basic JavaScript - Use Conditional Logic with If Statements

Link to the challenge:

This is the wrong condition. The if statement body will always execute.

Hey, thanks for clearing that up. I’ve checked the if statement and it’s now correct.

1 Like

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