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

Shana Gibson
Shana Gibson
8,788 Points

i guess im not understanding how to combine these strings with the # symbol, i've tried everything, i dont get it

var id = "23188xtr"; var lastName = " Smith";

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

i guess im not understanding how to combine these strings with the # symbol, i've tried everything, i dont get it, how do i combine the two var id and lastName with the pound symbol so that it reads 23188XTR#SMITH

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>

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I feel like you're doing really well and a lot of students get tripped up on this. I feel like maybe you're assigning some special importance to the # sign that isn't really there. It's just a character like any other.

That being said, you have a semicolon in the middle of the line which is the end of the statement and you definitely don't want that.

Let me try to give an example here without the actual solution. I'm going to turn everything to lower case and then combine it with an "@" symbol.

var myFirstName = "JENNIFER";
var myLastName = "NORDELL";

var nameJoinedWithAt = myFirstName.toLowerCase() + "@" + myLastName.toLowerCase();

The value that would then be stored in nameJoinedWithAt would be "jennifer@nordell".

I think you can get it with these hints, but let me know if you're still stuck! :sparkles:

Shana Gibson
Shana Gibson
8,788 Points

thank you so much, i did try that, but i did still have that semi colon there, thanks i was bout to go crazy lol!!