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 trialJonathan Adams
11,506 PointsI'm having trouble with this last part of the task. I can't figure out how to get the .toUpperCase function to work.
let firstName = "Jon";
let lastName = "Adams";
let role = "developer";
let word = role.toUpperCase();
var msg = firstName + " " + lastName + " : " + role;
Steven Parker
231,275 PointsYou can't declare (using "let") the same variable twice.
2 Answers
Steven Parker
231,275 PointsYou are using the ".toUpperCase" method correctly, but you are assigning the result to a new variable named "word", and "word" is not being used to create "msg".
Just substitute "word" for "role" in the final statement to pass the challenge.
Jonathan Adams
11,506 PointsThanks!
Corey Draper
3,452 PointsI have tried var and const still nothing. I have been stuck on this all day.
Steven Parker
231,275 PointsCorey Draper — you probably have a different issue. Start a fresh question where you can show your own code.
Corey Draper
3,452 PointsI finally figured it out. It was something simple. Thank you for replying.
Corey Draper
3,452 PointsCorey Draper
3,452 PointsI am not able to get this to work.
let firstName = "Corey"; let lastName = "Draper"; let role = "developer";
let role = role.toUpperCase();
var msg = firstName + ' ' + lastName + ': ' + role;