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 (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,813 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.