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.

Rhiannon Sadler
351 PointsI am stuck on section two of my challenge
the code i have on the screen already is.
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
And the instruction i was given is
Finally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "23188XTRSMITH"
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JavaScript Basics</title>
</head>
<body>
<script src="app.js"></script>
</body>
</html>
2 Answers

Steve Hunter
57,684 PointsI'm late to the party; my version of the solution looked like this:
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = userName + "#" + lastName.toUpperCase();
Glad you got it sorted!
Steve.

Justin Radcliffe
18,987 PointsHi Rhiannon,
This will work:
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName += '#';
userName += lastName.toUpperCase();
In the last 2 lines of code we're concatinating the # symbol, then the lastName variable converted to upper case.
[MOD: edited code block - srh]

Rhiannon Sadler
351 Pointssheesh, thankyou. I this course is really stepping up its skills huh. i would have never worked that out no matter how many times i watched the video again. Thankyou!
Rhiannon Sadler
351 PointsRhiannon Sadler
351 PointsThankyou bud! still nice to look at alternatives to it was still a big help.
Steve Hunter
57,684 PointsSteve Hunter
57,684 PointsNo problem!
JS isn't 'my thing' but feel free to tag me in any posts you make in here and I will try to help. You can do that Twitter-style with the 'at' symbol - Rhiannon Sadler <- like that.
Rhiannon Sadler
351 PointsRhiannon Sadler
351 PointsWill do! :)
Steve Hunter
57,684 PointsSteve Hunter
57,684 Points