Ten tries (resetting code) and get same ‘weird’ error that won’t let code run
I’d like to get this one checked off the list. Thanks.
**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);
**
Error:
SyntaxError: unknown: Unexpected token (14:0)
12 |
13 | testElseIf(7);
14 |
| ^
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);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.163 Safari/537.36
.
Challenge: Introducing Else If Statements
Link to the challenge: