Use Conditional Logic with If Statements

Use Conditional Logic with If Statements
0

#1

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:


#2

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).


#3

Thanks, it worked like a charm.