The following code is giving me an error that is apparently after the code? But not something that I wrote and it doesn’t go away and if I try to delete anything past the end of the line nothing happens.
function testElseIf(val) {
if (val > 10) {
return “Greater than 10”;
} else if (val < 5) {
return “Smaller than 5”;
} else {
return “Between 5 and 10”;
}
testElseIf(7);
SyntaxError: unknown: Unexpected token (10:14)
8 | }
9 |
10 | testElseIf(7);
| ^
I tried to re do the lesson in Chrome, log out and log back in but it’s not going away
I’m not sure why you @ed me, but that is what I was talking about when I said
to the OP
This sort of thing is why I recommend using proper indentation, to include indenting the entire function body. That makes missing braces far easier to catch.