Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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,373 Points

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

Steve Gallant
Steve Gallant
14,943 Points

Christopher is correct, comma is missing.