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

how do i string these variables?

im stuck and cant find my error

let firstName;
let lastName;
let role = 'developer';
firstName += "Jack";
lastName += "Taturyan";
let msg = firstName + " + " lastName ":" + role ;
Lee B
Lee B
1,141 Points

Close! You're missing a + between lastName and ":"

Lee B i just fixed it and it gave me an error, i feel like its such a silly mistake i keep overlooking

1 Answer

Steven Parker
Steven Parker
228,991 Points

In addition to a missing concatenation operator, it looks like another one got placed inside a string (" + " lastName) instead of between it and the variable (" " + lastName).