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

Ryan Abbott
Ryan Abbott
5,822 Points

Help, I am not sure what I am messing up. 1st time learner here.

Keeps saying the I didn't add the '#' between 'id' and 'lastName'.

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

var userName = (id) + "#" + (lastName);
userName.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>

Hi Ryan. I think it wants you to do everything on one line. Also, you don't need parentheses around your variable names.

So something like

var userName = upper case id + hash tag + upper case last name; 

5 Answers

Joshua Edwards
Joshua Edwards
52,175 Points

You need to apply toUpperCase() to post the id variable and the lastName variable while doing the assignment to the userName variable and not putting it all together and then doing toUpperCase() on it.

Michael Fish
Michael Fish
7,804 Points

Hi Ryan,

The challenge wants you to turn the # symbol into a variable. Try using this :

var id = "23188xtr";

var lastName = "Smith";

var hash = '#';

var userName = id.toUpperCase() + hash + lastName.toUpperCase();

Raymond Osier
Raymond Osier
16,581 Points

this is what you need to do in the first step ```var id = "23188xtr"; var lastName = "Smith";

var userName = id.toUpperCase ();

Raymond Osier
Raymond Osier
16,581 Points
// the second step should look something like this 
var id = "23188xtr";
var lastName = "Smith";

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

remeber when you are calling a function like the toUpperCase you must include () i can further exsplain what exactly this code means if you would like a more indepth review

Raymond Osier
Raymond Osier
16,581 Points

inside the var userName you are calling the var id and using the function toUpperCase() to change the value of id to all uppercase then you are concatenating that var by adding + with the string "#" and concatenating again with another

  • to the var lastName witch you called the same function of toUpperCase() on