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 (Retired) Storing and Tracking Information with Variables Using String Methods

I don't know how to go about solving this challenge, it's very confusing. I don't feel there's enough information.

Assign an all uppercase version of the id variable to the userName variable.

3 Variables are given: id, lastName, userName - but I don't feel like I understand what I am trying to accomplish.

Do I simply equate id = userName? How do I think about this Challenge? I think this section needs a bit more leading up to it because I didn't feel prepared like the previous challenges leading up to this.

.toUpperCase +=

Tried numerous things, can I get a tip?

2 Answers

rydavim
rydavim
18,786 Points

Remember that in the lessons, you learned about a string method you could use to make lowercase strings uppercase.

// So the id variable has a value of 23188xtr, which has lowercase letters in it.
var id = "23188xtr";
var lastName = "Smith";

// The first step of the challenge wants you to set the value of the username variable to be an uppercase version of id.
// So username should be 23188XTR, but do this using a string method - don't hard code it!
var username

If you'd like a bigger hint, the W3School's page for the method is here.

So, id.toUpperCase();

I think that works.