Website issue: Basic JavaScript - Comparisons with the Logical And Operator

Tell us what’s happening:
The “Run Test” button doesn’t seem to be working. I can’t make test run with a “Click” or using the keyboard.

Your code so far

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

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


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

testLogicalAnd(10);

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Comparisons with the Logical And Operator

Link to the challenge:

you have a syntax error here
the operator >= is not a valid operator where you have it. (Kevin’s explanation is better so see that instead)

It doesn’t work for me until I fix this.

That makes sense in English. This:

a > 5 && < 10

checking if a is greater than 5 and less than 10. But computers don’t usually work that way. You want to check two separate things - if it is greater than 5 and if it is less than 10. Those require two different conditions:

a > 5 && a < 10

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