I’m stuck and honestly, I don’t get the question.
Describe your issue in detail here.
**Your code so far**
function testLogicalOr(val) {
// Only change code below this line
if (val < 10 || > 20) {
return "Outside";
}
if (val) {
return "Outside";
}
// Only change code above this line
return "Inside";
}
testLogicalOr(15);
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36
Challenge: Comparisons with the Logical Or Operator
You are on the right track, you are just missing something. Notice the first comparison you use val:
val < 10
But in the second comparison you don’t:
> 20
So there is nothing on the left side of the > to compare to. This is actually a syntax error and thus your code won’t run. What do you think you need to do to fix this?
Also, you want to get rid of the second if statement completely, don’t you?
I forgot to use the Val in the second comparison. Also didn’t get rid of the second if. All I can think of that could also be wrong is the spacing. I made the changes you suggested I’ll continue trying.
Those were the only two changes I had to make to your code. There were no spacing issues for me. If you get stuck then please paste your updated code in here and we’ll be happy to help you out.
Hello. I made the changes but can’t pass. This is what I have. Thank you in advance.
gg
if (val < 10 || val > 20 ) {
return "Outside";
}
if (val) {
return "Outside";
}
// Only change code above this line
return "Inside";
}
testLogicalOr(15);