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

the # sign

i am stuck here and i have already got the answer for this quiz yesterday . the answer was with that sign # . my question is how should i recognaize that sign # if i have not learn about it until now ?

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

var userName
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

Benjamin Larson
Benjamin Larson
34,055 Points

The # symbol has no significant meaning in Javascript or in this example. It's just an arbitrary string to demonstrate concatenation.

so if i am not put it in the code it will be no demonstrate from concatenation?

yes, It is just there to help you demonstrate concatenation. Remember to set the lastName to use UPPERCASE also before you concatenate it to the userName variable. End result should look like this: userName = id.toUpperCase() + '#' + lastName.toUpperCase();

remember to use ' ' or " " around the # sign because as Benjamin said, it has no special meaning in JS

best answer