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

Javascript strings I can not figure out what is wrong.

Instructions about adding a string with the + sign. What is the problem. I've been looking and looking and don't see it.

app.js
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
var userName = id.toUpperCase + '#' + lastName.toUpperCase();
index.html
<!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>

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Arlene, The problem is with the last line of code. In the 2nd to last line, you declared the userName to be the upperCase of ID, which is correct. So now the upper case id is already userName, so your last line of code just needs to take that and add it to itself plus the # and lastName, and you are very close. The last line should be

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

I hope that makes sense. If not, please let me know. Keep Coding! Jason :)