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

jonathan machuca
seal-mask
.a{fill-rule:evenodd;}techdegree
jonathan machuca
Full Stack JavaScript Techdegree Student 506 Points

cannot read property "1" null

still don"t know what it could be

app.js
let firstName = "jonathan" ;
let lastName = "machuca" ;
let role = 'developer';
let msg = firstName + " " lastName + ": " role ;

2 Answers

Make sure you concat the strings properly in line 4

While Joy Ahmed is correct, I'm not sure if you spotted the mistakes since you didn't spot them on your own initially. Be sure to include the plus sign (+) between each section of your concatenated strings. You have one after your variables, before the space and colon space, but you didn't put one after the spaces:

//wrong
let msg = firstName + " " lastName + ": " role ;

//right
let msg = firstName + " " + lastName + ": " + role;

Also, as a matter of style (and to save yourself potential headache later), you should not put the extra space at the end of your code before the semicolon.