Basic JavaScript - Comparisons with the Logical And Operator

Tell us what’s happening:
I have used this code in VScode and everything worked fine, but the freecodeCamp program tells me that it does not work for numbers between 25 and 50. I do not know why…

Your code so far

function testLogicalAnd(val) {
  // Only change code below this line

  if (val <= 50 && val >= 25) {
    return "yes";
    
  }

  // Only change code above this line
  return "No";
}

testLogicalAnd(10);

Your browser information:

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

Challenge: Basic JavaScript - Comparisons with the Logical And Operator

Link to the challenge:

Take a look at the capitalization of returned string. Tests are expecting it to always start capitalized.

There is just a small mistake that is capitalization of the first letter of Yes and which tells a very important property of Js and that is Js is case sensitive language.

ohhh, you are so right, I was totally overlooking that… :see_no_evil: thank you…

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.