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

cant figure out carlos salgado

doing everything its taught me still cant get it

app.js
let firstName = "Carlos";
let lastName = "Salgado";
let role = 'developer';
var msg = ('firstName' + ' ' + 'lastName' + ': ' 'role');

3 Answers

Steven Parker
Steven Parker
231,275 Points

Well, you are close. But you should never put variable names in quotes. You also don't need the parentheses, but they don't affect passing the challenge.

I did it this way and I still can't get passed it either. it says I don't have a space between first name and last name.

let msg = firstName + ' ' + lastName + ': ' + role;

Steven Parker
Steven Parker
231,275 Points

This version passes task 2, I pasted it directly into the challenge to check it.

Ah, I had to paste it after I assigned firstName and lastName. Otherwise, I got the same error. Thank you though for your response.