Basic JavaScript - Comparisons with the Logical Or Operator

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

Your code so far
if (val > 10 || val < 20)
return “Outside”
return “Inside”

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

  if (val > 10 || val < 20) {
    return "Outside";
  }

   {
    
  }

  // Only change code above this line
  return "Inside";
}

;

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14541.0.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36

Challenge: Basic JavaScript - Comparisons with the Logical Or Operator

Link to the challenge:

It’s helpful if you can learn to describe the issues you’re having in your own words. Not only is it a vital skill in coding but also, the more you say, the more we can help.

You need to check your logic to ensure that it is definitely the right way around.

I think you need to work on your logic here just a little. If you think about it, any number you pass into the function is going to trigger this if statement.

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