This tutorial’s page is not running the test. Tried resetting the code several times. Also tried with my phone and still won’t run the test. Was having some similar issues in the lessons before this one. But managed to run the test on those. Not this one. (Won’t be able to advance until it’s figured out)
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:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.
It will not run, because you have a syntax error. The error is caused by you having an extra } after the if statement. Delete the extra } and the tests should run.
Not sure about debugging in the earlier sections of the new curriculum, but I believe they have added one later in the curriculum. Also, I believe they are working to add the console output back to the new site. Until then, you did the right thing and asked the forum about how to view possible errors without the old console feature.
Here’s my code. The syntax is fine, but the test button isn’t working, again.
function testLogicalAnd(val) {
// Only change code below this line
if (val <= 50 && >= 25) {
return "Yes";
}
// Only change code above this line
return "No";
}
// Change this value to test
testLogicalAnd(10);
Your if statement condition is the problem. When you make any comparison with a comparison operator such as >= to another value, you must always proceed it with another value (or variable in this case).
For example, if I want to check if val is greater than 3 and less than 10, I would write: