Comparisons with the Logical Or Operator 179

Comparisons with the Logical Or Operator 179
0.0 0

#1

Hey, I can’t get this to work. Can you see the mistake?

Your code so far

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

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

return "Inside";
}

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

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36.

Link to the challenge:


#2

Can you explain what you think the above code is checking?


#3

Hi! I just found it!
if( val > 20 || val < 10);{

Sometimes I struggle to pass the challenge and I am never sure if it is my logic that fails me or mistakes in typing, missed bracket etc.
I am not sure of the proper form of function. Are you able to recommend a good resource?

Thank you so much!


#4

Not sure what you are asking. Your function’s syntax is fine. It appears you now have the correct logic for your if statement.