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

I'm having trouble with this last part of the task. I can't figure out how to get the .toUpperCase function to work.

app.js
let firstName = "Jon";
let lastName = "Adams";
let role = "developer";

let word = role.toUpperCase();

var msg = firstName + " " + lastName + " : " + role;

I 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;

Steven Parker
Steven Parker
216,121 Points

You can't declare (using "let") the same variable twice.

2 Answers

Steven Parker
Steven Parker
216,121 Points

You 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.

Thanks!

I have tried var and const still nothing. I have been stuck on this all day.

Steven Parker
Steven Parker
216,121 Points

Corey Draper — you probably have a different issue. Start a fresh question where you can show your own code.

I finally figured it out. It was something simple. Thank you for replying.