Tell us what’s happening:
Q:
Combine the two if statements into one statement which will return “Yes” if val is less than or equal to 50 and greater than or equal to 25. Otherwise, will return “No”.
I can’t get this function to pass, and I’ve copied the answer based on the hint. Please help!! I think this code has a bug.
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";
// Change this value to test
testLogicalAnd(10);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/comparisons-with-the-logical-and-operator