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.

Cameron Gates
3,821 PointsJS Basics Code Challenge Problems
Can some help me understand what I am doing wrong? I have run out of ideas. Thanks!
var id = "23188xtr";
var lastName = "Smith";
alert(id.toUpperCase());
var userName = "23188xtr#" + "Smith";
alert(lastName.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>
4 Answers

Simon Coates
28,693 Pointsvar userName = id.toUpperCase() + "#"+lastName.toUpperCase();

Steven Parker
221,297 PointsThe challenge is based on variable assignments. Adding alerts may confuse the checking mechanism.
Simon's solution to task 2 is correct, but it's worth pointing out that each variable is converted separately to upper case, and the final string is created by concatenation (using "+") of the two variables with "#" in between.

Philipp Schweizer
4,501 PointsI am getting this error code: The userName
variable is "23188XTR#SMITH" not "23188XTR#SMITH". Which is confusing because they are the same.

Simon Coates
28,693 Pointsif you're still getting this, suggest posting your code to see if there's anything weird. If there isn't, then you might have stumbled across a bug and you should take a screenshot and send to support.

Philipp Schweizer
4,501 PointsI got it to work with the help of the forum. :)