Tell us what’s happening:
This is what I need to do : “Replace the two if statements with one statement, using the && operator, which will return “Yes” if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return “No”.”
Can someone check my code? Is there a bug to this or I got it wrong??
Your code so far
function testLogicalAnd(val) {
// Only change code below this line
if (val >= 50 && val <= 25){
return "Yes";
}
// Only change code above this line
return "No";
}
testLogicalAnd(10);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36.
Challenge: Comparisons with the Logical And Operator
Link to the challenge: