The console shows a syntax error in the line
testElseIf(7);
which I am not supposed to modify. It is saying the problem is the semi colon ; - this can’t be true. I can’t see anything wrong in my else if statements.
Grateful for any help.
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";
}
testElseIf(7);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
Challenge: Basic JavaScript - Introducing Else If Statements
Link to the challenge: