# Comparisons with the Logical And Operator Possible Bug?

**URL:** <https://forum.freecodecamp.org/t/comparisons-with-the-logical-and-operator-possible-bug/169554>\
**Category:** General\
**Created:** [January 18, 2018, 8:13pm UTC](https://forum.freecodecamp.org/t/comparisons-with-the-logical-and-operator-possible-bug/169554 "2018-01-18T20:13:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![msue82](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@msue82](https://forum.freecodecamp.org/u/msue82)\
**Post date:** [January 18, 2018, 8:13pm UTC](https://forum.freecodecamp.org/t/comparisons-with-the-logical-and-operator-possible-bug/169554/1 "2018-01-18T20:13:25Z")

</div>

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

```auto
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:**  
[https://www.freecodecamp.org/challenges/comparisons-with-the-logical-and-operator](https://www.freecodecamp.org/challenges/comparisons-with-the-logical-and-operator)

---

<div class="post-metadata">

**Author:** ![ArielLeslie](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arielleslie/32/264841_2.png) [@ArielLeslie](https://forum.freecodecamp.org/u/ArielLeslie)\
**Post date:** [January 18, 2018, 8:25pm UTC](https://forum.freecodecamp.org/t/comparisons-with-the-logical-and-operator-possible-bug/169554/2 "2018-01-18T20:25:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 16, 2021, 6:45pm UTC](https://forum.freecodecamp.org/t/comparisons-with-the-logical-and-operator-possible-bug/169554/3 "2021-01-16T18:45:09Z")

</div>


