Tell us what’s happening:
I cant run the tests in this one, every time i write a line, the console shows an error, and the “run the tests” button doesn’t work
Your code so far
function testElseIf(val) {
if (val > 10) {
return "Greater than 10";
}
else if (val < 5) {
return "Smaller than 5";
} else {
return "Between 5 and 10";
}
// Change this value to test
testElseIf(7);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36.
In a lot of ways, computers are extremely stupid. Leaving the bracket open can be enough to confuse it so it doesn’t know what to do or how to run tests.
the Run the test button didn’t work, because it doesn’t know what to do with malformed javascript code. It may have been that it tried to run your function, but because it wasn’t closed it causes a fatal error internally.
If you were to open the developer’s console (F12 on most browsers, but a pretty advanced topic), you’d see the error show up in there, saying something along the lines of “missing }”.