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 Combine Strings

Anica Bell
PLUS
Anica Bell
Courses Plus Student 3,004 Points

Can anyone tell me what is wrong with my code here?

For some reason my console is not displaying the message as displayed in the video it is simply displaying the code as it is written in the combine.js file. Thanks in advance!

const name = prompt("What is Your Name?"); let message = "Hello, " + name + ". Welcome to my History Site.";

message += "I'm so happy that you came by to visit,"; message += name; message += ". Feel free to come again and listen to more music.";

console.log(message);

Jamie Moore
Jamie Moore
3,950 Points

Hey Anica,

I just ran the code you provided and i'm getting a prompt, which asks for my name, then i'm getting this in the console:

Hello, Jamie. Welcome to my History Site.I'm so happy that you came by to visit,Jamie. Feel free to come again and listen to more music.

Is this what you want the code to do?

1 Answer

Anica Bell
PLUS
Anica Bell
Courses Plus Student 3,004 Points

Thanks Jamie! I don’t recall what the fix was but I was able to figure ut out. Thanks for your response!