Last task will not pass

Tell us what’s happening:
My code won’t pass the last task for some reason. ("trueOrFalse(false) should return “No, that was false” ) I have triple checked caps and spacing as well.

Your code so far

// Example
function ourTrueOrFalse(isItTrue) {
  if (isItTrue) { 
    return "Yes, it's true";
  }
  return "No, it's false";
}

// Setup
function trueOrFalse(wasThatTrue) {
  if (wasThatTrue); {
   return "Yes, that was true";
  }
   return "No, that was false";
  
    
}
// Change this value to test
trueOrFalse(true);
trueOrFalse(false);

Your browser information:

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

Link to the challenge:

You have a semi-colon at the end of your if statement condition which is causing trouble.

2 Likes

smh…Thank you. I’m curious tho. Why does the “true” test work, but not the “false” test? Wouldn’t both tests fail if an error occurred in my code prior to both the true and false return executions?

ahh…I see. Thanks for the help and answering my Q.

Remove semicolon from the if statement then see …It will work