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

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
229,732 Points

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

2 Answers

Steven Parker
Steven Parker
229,732 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
229,732 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.