mercredi 29 avril 2020

Are there any loopholes in the JS code below which prevents it fulfilling its statements? [closed]

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

It is from freeCodeCamp's JS 300 hour curriculum, and its requirements are: 1.trueOrFalse should be a function 2.trueOrFalse(true) should return a string 3.trueOrFalse(false) should return a string 4.trueOrFalse(true) should return "Yes, that was true" 5.trueOrFalse(false) should return "No, that was false"

Aucun commentaire:

Enregistrer un commentaire