Comparisons with the Logical And Operator1

Tell us what’s happening:

Your code so far


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

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

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

// Change this value to test
testLogicalAnd(10);

Your browser information:

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

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-javascript/comparisons-with-the-logical-and-operator

You need to combine these two if statements into one using the && operator :slight_smile:

You are trying to solve the problem with a nested if statement.
This challenge is asking you to “Combine the two if statements into one statement”.

So, you need to test these two comparitions on a single if using the AND (&&) Operator.