Https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/use-conditional-logic-with-if-statements

Tell us what’s happening:
the challenge, it’s not working, y change the string false a lot of times and
still does not approve, help needed, thank u

Your code so far


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

}

Your browser information:

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

Challenge: Use Conditional Logic with If Statements

Link to the challenge:

= is an assignment operator, try ===

1 Like

Welcome, lotryol.

This is assigning the value of true to the parameter wasThatTrue:

if(wasThatTrue=true){

Have a look at the way the example does it:

function test (myCondition) {
  if (myCondition) {

Hope this helps

1 Like