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

Jeremy Mao
seal-mask
.a{fill-rule:evenodd;}techdegree
Jeremy Mao
Full Stack JavaScript Techdegree Student 4,992 Points

I'm having trouble solving this.

Not sure what I'm doing wrong.

app.js
let firstName = 'Jeremy';
let lastName = 'Mao';
let role = 'developer';
let msg = firstName + ' ' + lastName + ': ' + role + '.';
let msg = role.toUpperCase();

1 Answer

There are 2 issues with your code. First, you are concatenating a period on to the end of role. You don't want to do that. Then, you are changing the entire msg by setting it equal to role.toUpperCase(); in your last line. Get rid of that line, and only apply the .toUpperCase() method to the role variable that is already part of your msg string. The value in the role variable will be capitalized and concatenated without you needing to add an additional assignment.

If you still need help, reply to this message and I'll clarify, but I think you can get it from here.

Yes, Jason is correct. You are reassigning the variable msg every time you use the keyword let. If you want to concatenate to the variable, just use the name and don't reassign it. Here's a hint. The value of msg when this program runs is just "DEVELOPER".