Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript and the DOM (Retiring) Responding to User Interaction Functions as Parameters

Muhamed Asil
Muhamed Asil
7,453 Points

Uncaught SyntaxError: missing ) after argument list

I have created temp.js file and wrote that code inside it, typical like the lesson.

function  say(something) {
  console.log(something);
}

function exec(func, arg) {
  func(arg);
}
exec(say 'Hi, there');

then chrome's console shown this error message:

Uncaught SyntaxError: missing ) after argument list

injecting StackUp content script

I don't know where's the error, so anyone help, please. Thank you

1 Answer

Christopher Debove
PLUS
Christopher Debove
Courses Plus Student 18,371 Points

Hi Muhamed, look at your exec call =) It takes 2 arguments, but your missing something between the two ;)

Steve Gallant
Steve Gallant
14,915 Points

Christopher is correct, comma is missing.