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 trialManny Ramos
2,699 Pointsi literally spent 1 hour trying to figure this out
var id = "23188xtr"; var lastName = "Smith"; id.toUpperCase(); var userName lastName.toUpperCase(); userName = (id + "#" + lastName);
the code only outputs lower case letters besides the S. i need to make sure that the username outputs all in cap letters and with # in the middle of the id and last name. what am i doing wrong?
var id = "23188xtr";
var lastName = "Smith";
id.toUpperCase();
var userName
lastName.toUpperCase();
userName = (id + "#" + lastName);
<!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>
8 Answers
Karen Freeman-Smith
29,248 PointsThe line above "lastname.toUpperCase()" is missing a semi-colon. Otherwise your code looks good.
Manny Ramos
2,699 Pointsi did that and it still says its not upper case. thanks for the reply though.
Manny Ramos
2,699 Pointsi think im doing it correctly but it literally keeps telling me this
Bummer! The userName
variable is "23188xtr#Smith" not "23188XTR#SMITH".
Karen Freeman-Smith
29,248 PointsI got it to work by using: id=id.toUpperCase(); and lastName=lastName.toUpperCase();
I think I used the method when I put the string together: userName = (id.toUpperCase() + "#" + lastName.toUpperCase()); It looks like you have to put it back into the variable with the "=" if you do it in a separate step.
Manny Ramos
2,699 Pointsvar id = "23188xtr"; var lastName = "Smith"; id.toUpperCase(); var userName; lastName.toUpperCase(); id = id.toUpperCase(); lastName = lastName.toUpperCase(); userName = (id + "#" + lastName);
Bummer! The userName
variable is "23188XTR#SMITH" not "23188XTR#SMITH".
lol this is weird. do i have to put uppercase method after i already declared the new value? thanks for answering!
Karen Freeman-Smith
29,248 PointsThat error message makes no sense at all!
It looks like you have both id.toUpperCase(); AND id=id.toUpperCase(); (same with the last name...)
Get rid of the extra lines (the two without "=") and see how the program likes it then...
Manny Ramos
2,699 Pointsit worked! wow i think that means im friend for the night already. thanks so much for the fast replies you are amazing! is this a sign that coding isnt for me?
Karen Freeman-Smith
29,248 PointsNo, it happens all the time, and to everyone once in a while. The more mistakes you make, the more you learn. I wouldn't be able to help if I hadn't made the same mistakes myself.