I think the lesson “Comparisons with the Logical And Operator” in Basic JavaScript module is broken. I followed the steps in the explanation and when it didn’t work I figured I must’ve done something wrong. I went to the Hint page and my code was correct, so the official solution is wrong. The only way I have gotten it to pass is by submitting with the default code (which is an applicable solution since the default is just a nested if statement rather than a logical and). In the description it listed the function as being named something different than is in the code, so I tried changing the function name in the code, no dice. Tldr; it’s broken.
Hi beansprout01 welcome to the forum!
Can you post your code and a link to the challenge?
function testLogicalAnd(val) {
// Only change code below this line
if (val >= 25 && val <= 50) {
return "Yes";
}
return "No";
// Only change code above this line
}
// Change this value to test
testLogicalAnd(10);
Also, the default code no longer works.
Is this the code that didn’t work for you? Because it passes for me.
1 Like
It is. Maybe the problem is my browser?
Edit: I just tried the code again and it worked. Strange.
A lot of times it is some problem with the browser. But I don’t know what it was here. Glad it’s working now!
General realization about FreeCodeCamp:
- in 99.99% of the time, there is no bug, only a problem with your a) code or b) your setup