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 trialJayson Camacho
Full Stack JavaScript Techdegree Student 3,006 PointsI 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.
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName += lastName;
alert(userName);
console.log(userName);
<!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
Steve Hunter
57,712 PointsHI 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.
Steve Hunter
57,712 PointsHi 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
Full Stack JavaScript Techdegree Student 3,006 PointsThanks 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
16,280 PointsWhat if you tried...
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase() + lastName;
alert(userName);
console.log(userName);
Jayson Camacho
Full Stack JavaScript Techdegree Student 3,006 PointsJayson Camacho
Full Stack JavaScript Techdegree Student 3,006 PointsMy goodness! Sometimes I can't read good. Thank you!
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsNo problem! I do that all the time!!