# Comparisons with the Logical Or Operator

Comparisons with the Logical Or Operator
0

#1

This is there code

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

if (val) {
return “Outside”;
}

if (val) {
return “Outside”;
}

// Only change code above this line
return “Inside”;
}

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

This my code below

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

if (val > 21 || val > 21) {
return “Outside”;
}

// Only change code above this line
return “Inside”;
}

// Change this value to test

testLogicalOr(21);

#2

Instructions
Combine the two if statements into one statement which returns “Outside” if val is not between 10 and 20, inclusive. Otherwise, return “Inside”.

#3

your code is not fulfilling the requirements given in the instructions. Basically you should look at your numbers in the if statement. in English if val is less than 10 or greater than 21, number will be out of range. If I say anything else, it would be the solution. I can do that if you want. Keep at it mate.

#4

yes. I don’t the test part

#5

The solution is:

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

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

// Only change code above this line
return “Inside”;
}

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