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 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,997 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!

Gabriela Miranda
Gabriela Miranda
202 Points

Anica Bell if you remember. what was the fix. I am just srtruggling whith that lesson.