Invisible "Unexpected Token"

Tell us what’s happening:
It’s giving me this unexpected token that doesn’t even exists. And according to me and the video and the hints, my code is correct but it keeps giving me this unexpected token error( An invisible token)

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";
} 

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.113 Safari/537.36.

Challenge: Introducing Else If Statements

Link to the challenge:

“Unexpected token” usually means that you are missing a closing brace, bracket, quotes, etc, or a semicolon.

If the code you included is everything you have, then you are missing a } at the end of your function.

2 Likes

you are missing a } at the end.