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

cannot read property '1' of null... WHAT does this mean?

app.js
let firstName = "Glenn\";
let lastName = "Robinson: ";
let role = 'developer';
let urole = role.toUpperCase;
let msg = firstName + lastName + urole;

console.log(msg);

2 Answers

Steven Parker
Steven Parker
231,269 Points

The backslash on the top line is causing a syntax error that is confusing the checking mechanism. Remove that and you should see more meaningful hints in the error messages regarding the remaining issues.

Tobias Kloy
Tobias Kloy
3,655 Points

Hi Glenn,

I found two things in your Code:

  • The "\" does not belong after "Glenn"
  • As "toUpperCase" is a method you have to add "()" behind
let firstName = "Glenn";
let lastName = "Robinson: ";
let role = 'developer';
let urole = role.toUpperCase();
let msg = firstName + lastName + urole

You can now output msg with console.log and it will print "GlennRobinson: DEVELOPER".