Comparisons with the Logical And Operator Possible Bug?

Comparisons with the Logical And Operator Possible Bug?
0

#1

Tell us what’s happening:

Q:

Combine the two if statements into one statement which will return “Yes” if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return “No”.

I can’t get this function to pass, and I’ve copied the answer based on the hint. Please help!! I think this code has a bug.

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

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36.

Link to the challenge:


#2

Check where your { and } (commonly called “curly braces”) are. Do you have matching pairs? Are the ending braces in the right place? Your code should give a warning in the editor. Can you see it? Does the warning make sense?