Comparisons with the Logical Or Operator Bug Please fix :l

Comparisons with the Logical Or Operator Bug Please fix :l
0.0 0

#1

Tell us what’s happening:
Pretty much this is impossible so I don’t know why this answer is right fix this, please.

Your code so far


function testLogicalOr(val) {
  // Only change code below this line
  if (val < 10 || val > 20) {
    return "Outside";
  }
  // Only change code above this line
  return "Inside";
}

// Change this value to test
testLogicalOr(15);

Your browser information:

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

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


#2

Your code passes. Did you remember to click the “Run the Tests” button?


#3

So if you look at the directions it doesn’t say to have less than ten and greater than 20 it said the opposite of that so it’s a bug.


#4

No, it says return “Outside” if the value is not between 10 and 20, which that code does. If the value is less than 10 or greater than 20 it is not between 10 and 20. -600 or 1 are less than 10. 21 or 633794 are greater than 20. So those correctly return “Outside” .


#5

Oh, well I’m a complete dumbass sorry for bothering you.