Comparisons with the Logical Or Operator help

Tell us what’s happening:

Your code so far


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

  if (val < 20 || val > 10) {
    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 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0.

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

It should be the other way around like this.

val > 20 || val < 10

You want to check if the value is greater than 20 or less than 10.

3 Likes

Thanks idk why i got it backwards