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 trialJeremy Mao
Full Stack JavaScript Techdegree Student 4,992 PointsI'm having trouble solving this.
Not sure what I'm doing wrong.
let firstName = 'Jeremy';
let lastName = 'Mao';
let role = 'developer';
let msg = firstName + ' ' + lastName + ': ' + role + '.';
let msg = role.toUpperCase();
1 Answer
Jason Larson
8,361 PointsThere 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.
Andrew Hickman
Full Stack JavaScript Techdegree Graduate 22,832 PointsAndrew Hickman
Full Stack JavaScript Techdegree Graduate 22,832 PointsYes, Jason is correct. You are reassigning the variable
msg
every time you use the keywordlet
. If you want to concatenate to the variable, just use the name and don't reassign it. Here's a hint. The value ofmsg
when this program runs is just "DEVELOPER".