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

Marcos Melonee
PLUS
Marcos Melonee
Courses Plus Student 2,338 Points

Now i could not see the error in this challenge..

http://teamtreehouse.com/library/javascript-basics-2/storing-and-tracking-information-with-variables/using-string-methods

var id = "23188xtr"; var lastName = "Smith";

var userName = id + '#' + lastName; document.write(userName.toUpperCase());

Help me plese!

3 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

The code challenge is looking to see if the proper uppercased string is inside the variable, not printed to the document.

You don't need to print it out to the page using document.write(). You need to assign the uppercased version to the userName variable.

Marcos Melonee
PLUS
Marcos Melonee
Courses Plus Student 2,338 Points

maybe

var userName = id + '#' + lastName; userName.toUpperCase();

Dave McFarland
Dave McFarland
Treehouse Teacher

The toUpperCase() method only returns an uppercase version of the string; the string inside the variable doesn't change. You ned to assign the upperCased string back into the variable. This is one way"

var userName = id + '#' + lastName;
userName = userName.toUpperCase();
Marcos Melonee
PLUS
Marcos Melonee
Courses Plus Student 2,338 Points

I understand thank you, I was trying: var id = "23188xtr"; var lastName = "Smith";

var userName = id + '#' + lastName; userName.toUpperCase ();