Basic JavaScript: Use Conditional Logic with If Statements

Basic JavaScript: Use Conditional Logic with If Statements
0

#1

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

The last "trueOrFalse(false) should return “No, that was false” challenge is not passing. why?

function trueOrFalse(wasThatTrue) {

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

}



#2

You used an assignment operator instead of an equality. This ‘=’ and ‘==’ are not same!


#4

Thanks a lot, that fixed it :slight_smile: i hadn’t learned the difference (i think) but i wasn’t even supposed to use either. Just if (statement) worked fine.