Use Conditional Logic with If Statements

Hey, it doesn’t seem like this page is working. Am I doing something wrong?

Here’s my code:

// Setup
function trueOrFalse(wasThatTrue) {

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

     return "No, that was false";
  
  // Only change code above this line.

}

// Change this value to test
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/60.0.3112.113 Safari/537.36.

Link to the challenge:
https://www.freecodecamp.org/challenges/use-conditional-logic-with-if-statements

In your if statement condition you are using trueorFalse, but that is the name of the function. You need to use the argument which was passed into the function (wasThatTrue).

1 Like

Thanks, it worked like a charm.