Basic JavaScript - Write Reusable JavaScript with Functions (can't run the test/ SyntaxError)

Is there any thing goes worng?

I can’t do the “run the test”.

And also my console shows: SyntaxError: unknown: Unexpected token, expected “{” (5:27)

What’s happened? Thank you for your helping in advance.

Your code so far

function reusableFunction() {
  console.log("Hi World");

function reusableFunction();

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic JavaScript - Write Reusable JavaScript with Functions

Link to the challenge:

The function keyword is used to define a function. So with that function you have at the bottom it is assuming you are trying to define another function, which should have {} for the body. That is why you are getting that error. To call a function you just put the functions name and ().

1 Like

ohhhhh, get it. I am so dumb. Didn’t find that mistake.
Thank you so much.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.