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 trialChad Duncan
1,246 PointsFinally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "231
I am so not understanding what the answer is here....
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
<!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>
16 Answers
Erik c
Front End Web Development Techdegree Student 3,560 PointsYou need to concatenate var userName and var lastName. Remember everything inside quotes becomes a string
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase() + "#"; // 23188XTR#
userName += lastName.toUpperCase(); // 23188XTR#SMITH
Safae Chkirate
6,113 PointsHello !
Me too completely lost, I finally passed the test:
var id = "23188xtr";
var lastName = "#Smith";
var userName = id.toUpperCase() + lastName.toUpperCase();
Jonathan Wogenius
1,981 PointsHI, This works:
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
var userName = id.toUpperCase() +'#' + lastName.toUpperCase();
Nadia Masiero
3,468 PointsThis is correct. Thanks!
Jessica Mateo
2,952 Pointsthank you!
Eniko Pap-David
4,798 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName = id.toUpperCase() +'#' + lastName.toUpperCase();
Unsubscribed User
3,551 PointsThis is just frustrating ....
Leonardo Hernandez
13,798 PointsConcatenate the hash symbol and the lastName variable to what you have from the first part of the challenge.
The lastName string also needs to be upper case as well so you will have to call that method again.
Chad Duncan
1,246 PointsIts starting to make sense, Im just for some reason not setting it up right.....
MD NOMAN HOSSAIN
10,833 PointsIt should be like this...
var id = "23188xtr"; var lastName = "Smith";
var userName = id.toUpperCase(); userName += "#" + lastName.toUpperCase();
billy mccoll
2,307 Pointstask 1 asks you to give this answer so the second part asks you to add how i solved this was easy just remove semi colon
var userName = id.toUpperCase();
task 2 answer removing the semi colon then fill in what the question asks add # now by using + add your last part lastName.toUpperCase() and now add the semi colon....
hope this helps
var userName = id.toUpperCase() + '#' + lastName.toUpperCase();
Carlos Delgado
437 PointsOff Course the semicolon Closes it ..Thanks
Jon N
829 PointsYou need to add .toUpperCase before lastName This makes me want to give up coding. It's so complicated! I never would have gotten it right. If you lost concentration for 2 seconds, it all becomes gibberish.
Shuvam Roy
2,753 Pointsvar id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase()+ '#'+ lastName.toUpperCase();
Chad Duncan
1,246 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName = (id + '#' + lastName).toUpperCase();
this is my answer, it is now telling me "Oops! It looks like Task 1 is no longer passing."
Any incite on what i am doing wrong here?
Leonardo Hernandez
13,798 PointsSorry I'm late!
You almost have it. I actually tried the same thing when I went over it.
var id = "23188xtr";
var lastName = "Smith";
//Needs to be 23188XTR#SMITH
var username = id.toUpperCase() // '23188XTR'
var username = id.toUpperCase() + '#' // '23188XTR#'
var username = id.toUpperCase() + '#' + lastName // 23188XTR#Smith
//Finish up by adding the toUpperCase method to what needs to be uppercase.
Andrew Aramouni
2,370 Pointsi did userName = id.toUpperCase(); userName += '#'; userName += lastName; /* So it said it was working. I seriously dont see a problem with it. *\
Chad Duncan
1,246 PointsI completely forgot to post... after doing some searches on line i finally figured out the answer... although, it looks different from here, it still passed... thanks so much for the help!!
Midhun Chandran
9,414 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName; userName = id.toUpperCase() + '#'+ lastName.toUpperCase();
Andrew Aramouni
2,370 Pointssorry IT WASNT WORKING. Thats what i meant to say.
stepan romanchuk
5,597 Pointsvar username = (id + '#' + lastName ).toUpperCase();
Chad Duncan
1,246 Pointsthis is driving me crazy... lol
var id = "23188xtr"; var lastName = "Smith"; var userName = "id + #(lastName) Smith"; var userName = id.toUpperCase(); var userName = lastName.toUpperCase();