# Confused in Comparisons with the Logical Or Operator challenge

**URL:** <https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894>\
**Category:** General\
**Created:** [April 17, 2017, 7:44pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894 "2017-04-17T19:44:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshayv97](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/akshayv97/32/240171_2.png) [@akshayv97](https://forum.freecodecamp.org/u/akshayv97)\
**Post date:** [April 17, 2017, 7:44pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894/1 "2017-04-17T19:44:59Z")

</div>

```auto
function testLogicalOr(val) {
  if (val>10||val<=20) {
    return "Outside";
  }
  return "Inside";
}
testLogicalOr(20);

```

---

<div class="post-metadata">

**Author:** ![BenGitter](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/bengitter/32/12192_2.png) [@BenGitter](https://forum.freecodecamp.org/u/BenGitter)\
**Post date:** [April 17, 2017, 7:50pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894/2 "2017-04-17T19:50:01Z")

</div>

I cleaned up your code.  
You need to use triple backticks to post code to the forum.  
See [this post for details](http://forum.freecodecamp.com/t/forum-code-formatting/25574).

You are mixing “Outside” and “Inside”. The function should return “Outside” when `val` is NOT between 10 and 20, inclusive (so 10 and 20 are still “Inside”).

---

<div class="post-metadata">

**Author:** ![shashank7200](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/shashank7200/32/104572_2.png) [@shashank7200](https://forum.freecodecamp.org/u/shashank7200)\
**Post date:** [April 17, 2017, 8:01pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894/3 "2017-04-17T20:01:52Z")

</div>

@akshayv97 Follow the add ups @BenGitter suggested, you need to check the value whether they are not between 10 and 20 .

---

<div class="post-metadata">

**Author:** ![akshayv97](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/akshayv97/32/240171_2.png) [@akshayv97](https://forum.freecodecamp.org/u/akshayv97)\
**Post date:** [April 18, 2017, 5:55pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894/4 "2017-04-18T17:55:45Z")

</div>

Thank you all guy’s for your help!

---

<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 17, 2021, 8:52pm UTC](https://forum.freecodecamp.org/t/confused-in-comparisons-with-the-logical-or-operator-challenge/106894/5 "2021-01-17T20:52:30Z")

</div>

Closed on January 17, 2021, 8:52pm UTC


