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

Jayson Camacho
seal-mask
.a{fill-rule:evenodd;}techdegree
Jayson Camacho
Full Stack JavaScript Techdegree Student 3,006 Points

I had set up my alert and console log; they both tell me that I had it right. I also use dev check on google.

I got the Bummer message saying my work produced a # in between the id and last name. It also states that I have lastName all caps as well. This isn't the case when I checked my work.

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

var userName = id.toUpperCase();
userName += lastName;
alert(userName);
console.log(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

HI Jayson,

The question wants the hash symbol in there. That's what the error message is telling you. Your userName variable contains 23188XTRSmith and not 23188XTR#SMITH - the challenge is looking for the latter version.

The question says, add a # symbol and lastName and points out your result should be The final value of userName is "23188XTR#SMITH". So, the challenge requires the hash symbol in there to pass.

Steve.

No problem! I do that all the time!! :smile: :+1:

Hi Jayson,

For the second part of theis challenge you want to add a hash symbol and then the lastName in uppercase to the end of the userName variable. You seem to have missed the '#' out of your finished string.

Try:

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

Here, userName starts with having the contents of the id variable in uppercase. Then I've added the hash and followed that with the uppercase lastName.

Make sense?

Steve.

Jayson Camacho
seal-mask
.a{fill-rule:evenodd;}techdegree
Jayson Camacho
Full Stack JavaScript Techdegree Student 3,006 Points

Thanks for the response! I meant to say the # is popping out of no where. I don't want that in there. Some how I get this message... --Bummer! The userName variable is "23188XTRSmith" not "23188XTR#SMITH".--

When I do my console log it says I don't have the #. I don't have that # in my code at all. Why does it just pop up? My user name when I do my alert is 23188XTRSmith not 23188XTR#SMITH.

Chris Davis
Chris Davis
16,280 Points

What if you tried...

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

var userName = id.toUpperCase() + lastName;
alert(userName);
console.log(userName);