Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

Patrick Thomas
seal-mask
.a{fill-rule:evenodd;}techdegree
Patrick Thomas
Full Stack JavaScript Techdegree Student 3,513 Points

What is property one? Is that the first line of code that I am missing?

So, I am trying to figure out whether I the error message is on the first line or another line. It's saying can not read property 1 of null? Which code is it?

app.js
let firstName;
let lastName;
let role = 'developer';
let developer += "Patrick + Thomas;

1 Answer

Steven Parker
Steven Parker
220,425 Points

Despite the peculiar error message, the main issue is unbalanced quotes (there's only one) on the last line. But you have a few additional issues:

  • your names should be assigned to the variables as they are created on lines 1 and 2
  • all later references should be made using the variables instead of literal strings
  • the instructions ask for the new variable to be named msg instead of developer
  • the "+=" operator can't be used when first creating a variable (but you won't need it here anyway)
Patrick Thomas
seal-mask
.a{fill-rule:evenodd;}techdegree
Patrick Thomas
Full Stack JavaScript Techdegree Student 3,513 Points

Below role, create a new variable named msg that combines the firstName, lastName and role variables to create a string like "Carlos Salgado: developer".

Bummer: Make sure you're adding one space (' ') between firstName and lastName.

Now I'm getting this message, I have no idea what to do.

Steven Parker
Steven Parker
220,425 Points

Please show the code with all your recent changes.