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

dont know what to do here ! i will be glad for help .

i am newbe in program language at all ,and try to understand the logic of it . i understand the lessons and i think that i am in progress untill i got this kind of question . i didnt even try to solve it cause i dont know where to begin . i need a motivated help .

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>

2 Answers

Thomas Fildes
Thomas Fildes
22,687 Points

Hi Omer,

This question can be quite daunting at first but do not let it get you down. To pass this you need to use some concatenation with variables and a string in between. You can achieve this with the below code:

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

The # is a string that sits in between the two variables and the variables have been changed to uppercase by the .toUpperCase() method. You concatenate using the +.

Hope this helps! Happy Coding!!!

until now i didnt learn the # sign so how can i come up with it ? by guessing ? i thought that the quizes belong for only what we are learnning . how can you explain it ?

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

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

We take the id var and use the .toUpperCase() string method to assign it in upper case letters, then we use in the addition operator (+) in order to add another string, '#', then we add the lastName var in upper case letters, too.

until now i didnt learn the # sign so how can i come up with it ? by guessing ? i thought that the quizes belong for only what we are learnning . how can you explain it ?