Basic JavaScript - Use Conditional Logic with If Statements

I’m back again with duplicates :

Can someone please help with this problem…?
I don’t understand where I’m going wrong, I’m just a newbie.

Below is my code

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

}

Your browser information:

User Agent is: Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Mobile Safari/537.36

Challenge Information:

Basic JavaScript - Use Conditional Logic with If Statements

1 Like

Declare the if statement once. Just follow the example provided in the lesson.

2 Likes

Thank you very much stephenmutheu, it worked and I have realized that it takes Courage to success.

1 Like

Yes. Don’t be afraid to make mistakes. That’s how we learn.

Keep up the good work, mate.

1 Like