Logical AND Operators

← My code here is correct, yeah? I cannot even get the test to run. Anyone else having these problems? →

  **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";

  **Your browser information:**

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

Challenge: Comparisons with the Logical And Operator

Link to the challenge:

Almost but not quite. You have to include val in each of those comparisons. In English we can say “if val is less than equal to 50 and greater than equal to 25” and understand exactly what that means. Computers aren’t quite that smart. They need you to spell it out for them in greater detail :slight_smile:

UPDATE: Actually, maybe I should say “JS” isn’t that smart. There may be programming languages in which you can use shortcuts like this?

1 Like

Thank you so much! I didn’t even notice it. Usually I miss a semicolon or something minute… Thank you again.

Happens to the best of us :slight_smile: