I'm getting a `SyntaxError: Unexpected token {` error message, what is wrong?


#1

Question

I’m getting a SyntaxError: Unexpected token { error message, what is wrong?

Answer

It is likely that you forgot the function keyword when declaring your function. Make sure you’re declaring your function like so: function functionName(...) { ... } not like: functionName(...) { ... }.