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 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.");