Question regarding the <>

Tell us what’s happening:
Describe your issue in detail here.

In this exercise, i’m trying to understand why it is asking me to add in the values to say val < 10 || val > 20. So my question is, why would I be writing that the value is less than 10 or more than 20? what about in between? Is it so that if it is true, it will be less than 10 and more than 20, and if false it’d be less than 20 but more than 10? i’m slightly confused with that analogy.

Thanks

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

testLogicalOr(15);
  **Your browser information:**

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15

Challenge: Comparisons with the Logical Or Operator

Link to the challenge:

This statement is true if
a) val is greater than 20
OR
b) val is less than 10

Either a or b can be true in order for this condition to be met.

If neither a nor b is true, then we know that
a) val is less than or equal to 20
AND
b) val is greater than or equal to 10

1 Like

Thank you so much! I know it’s a silly question but I appreciate your time answering it :slight_smile: trying to ask as many questions as possible for clarification and better understanding thanks!!

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.