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

Umm, Dave - I did as you said and it still doesn't work?

Hi, Dave - see ... I copy & pasted your rpely to me as you advised & it gives me the same answer

app.js
var id = "23188xtr";
var lastName = "Smith";

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>

3 Answers

Cory Harkins
Cory Harkins
16,500 Points

You have a syntax error after id.toUpperCase()

remove the semi-colon

Thanks, Cory - I just did that per another advisor (which I'm pretty sure is something I tried before getting to the point of asking for help) - it still doesn't work. I actually copy & pasted it from the 2nd person - which was exactly the same as yours - it doesn't work. Thanks so much!

This is the correct solution:

var userName = id.toUpperCase() + "#" + lastname.toUpperCase();

The semicolon after the first call of toUpperCase is what causes it to fail as this is a syntax error.

Dave StSomeWhere
Dave StSomeWhere
19,870 Points

Ummm, skehrt - here's what is needed for the challenge:

If you follow the challenge they have you to add the # (pound sign) and upper case to the userName defined in task 1. So you need to show the completed task 1 and a separate statement for task 2 - something like below:

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