Syntax error on else


I'm not sure what's wrong with my else syntax.


you're missing a } to close the function also what does the 3 make after the semicolon?
And be careful with your sentences as the SCT only accepts matches so " test" is not "test"


I'm still getting an error on my ELSE. That's what's been confusing me.


You have to {} for your if condition therefore the } before else will be interpreted to close the function and now the else is alone without any if belonging to it. Which doesn't make much sense to have an exception without a rule in the first place. Sry didn't noticed that in the first run.


you are missing a } I would put it on line 12 and a { on line 6 before return


I removed the brackets surrounding the if statement but I'm still getting an unexpected token if. I even checked the hint which shows if/else syntax and my code doesn't seem to deviate from the formula so I'm not sure what's wrong.


The {} after the function keyword are mandatory the problem was that your if lacked an opening } and your function lacked a closing }.