Basic JavaScript - Use Conditional Logic with If Statements

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

function trueOrFalse(wasThatTrue) {
  // Only change code below this line
return true; 
  // 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.5.2 Safari/605.1.15

Challenge: Basic JavaScript - Use Conditional Logic with If Statements

Link to the challenge:

So, the directions say

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.

You can take a look at the example the challenge gives you

function test (myCondition) {
  if (myCondition) {
    return "It was true";
  }
  return "It was false";
}

test(true);
test(false);

You are going to do something like this

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

function trueOrFalse(wasThatTrue) {
  // Only change code below this line
if (wasThatTrue) { return "It was true";
}
return "It was false"; 
  // Only change code above this line

}
trueOrFalse(true);
trueOrFalse(false);

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.5.2 Safari/605.1.15

Challenge: Basic JavaScript - Use Conditional Logic with If Statements

Link to the challenge:

Please Tell us what’s happening in your own words.

Learning to describe problems is hard, but it is an important part of learning how to code.

Also, the more you say, the more we can help!

I am trying to return the string trueOrFalse(false) and trueOrFalse(true). those are the only two things left to complete on this test

Are these the strings the instructions are asking you to return?

yes, it is. I already established trueOrFalse should be a function, trueOr False(true ) should return a string, also for false, the problem is trueOrFalse(true) should return the string Yes it was true and if false no it was false

These are the instructions:

“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.”

I don’t see the strings “Yes, that was true” and “No, that was false” in your code.

I just got it, I realized that I didn’t read the instructions clearly, it should’ve been; Yes, that was true and No, that was false

If you have a question about a specific challenge as it relates to your written code for that challenge need some help, click the Ask for Help button. This button will create a new topic with all code you have written and include a link to the challenge also. You will still be able to ask any questions in the post before submitting it to the forum.

Thank you.