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.

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables Using String Methods

Is it frustrating on purpose?

I can't figure out the syntax the lesson is looking for. We are supposed to string id and lastName together with a # between the id and lastName and the whole thing is supposed to be in all caps. For some reason no matter how I write it the # is not recognized. What is the trick because I can not figure it out by watching the video or looking through the MDN JavaScript reference page.

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

var userName = id + "#" + 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

William Li
PLUS
William Li
Courses Plus Student 26,867 Points

You didn't upcase the id

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

I will try this, I was adding it all in one command then ending it .toUpperCase.

Hugo Paz
Hugo Paz
15,622 Points

If you want to call the method only once you can do it like so:

var userName = (id + "#" + lastName).toUpperCase();
Hugo Paz
Hugo Paz
15,622 Points

Hi Jeremiah,

You are supposed to have the id in caps too.

So you need to change your code to:

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

This is why its giving you an error on the #.

Thank you everyone for all the help! As I get farther on it just keeps getting a little tougher.