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 Basics Working with Strings Introducing Strings

missing ) after argument list

this is my code on one single line:

alert("Your personal information are as follows:" "Your name is " + name "You are " + age + " years old.");

('name' and 'age' are defined variables) and then I got this error:

Uncaught SyntaxError: missing ) after argument list indicating the line with the above code.

I simply don't see how a ) could be missing?

1 Answer

Hi Chun,

The problem is that you can't pass two or more strings to alert method. If you look closely you can see that after follows: you are closing the string with double quotes and then starting new string. That's why alert method expects ')' after closing the string. All you have to do is to get rid off unnecessary double quotes. Also there was missing + sign so you would get another error - exactly same actually - missing ')'. See the code below.:

alert("Your personal information are as follows: Your name is " + name + ". You are " + age + " years old.");