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 and Manipulate Strings

Can i get a hint

i use the previous method which is prompt

app.js
let firstName = prompt('Jacquelyn');
let lastName = prompt('Springs');
let message = ("firstName" + "lastName");

1 Answer

Blaize Pennington
Blaize Pennington
13,879 Points

So first off, there is no need to use prompt for this challenge. Just assign the variable using

let firstName = "Jacquelyn";
let lastName = "Springs";
let role = "Developer";

Now to put it all together it is asking you to concatenate a string which can be done with + symbols.

let msg = "This is a string that has been concatenated by " + firstName + " who is a " + role;

or alternatively you can use backticks to make it easier, but I believe that is a later tutorial.

let msg = `This is a string that has been concatenated by ${firstName} who is a ${role}`;