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 trialSean Flanagan
33,235 PointsTask 2
Where am I going wrong with the #? I can't find anything that requires the use of a #.
Cheers
Sean
var id = "23188xtr";
var lastName = "Smith";
var username = id.toUpperCase();
var 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>
3 Answers
Grace Kelly
33,990 PointsHi Sean,
The task asks for a "#" inbetween the id and the username just add it and it should pass, like so:
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = userName + '#' + lastName.toUpperCase();
Note in my code I added a toUpperCase() to the lastName variable as the end result should be "23188XTR#SMITH"
Sean Flanagan
33,235 PointsHi Grace. I've tried this but it's still not working.
var id = "23188xtr";
var lastName = "Smith";
var username = id.toUpperCase();
userName = userName + '#' + lastName.toUpperCase();
I get a message saying "Did you add the '#' character between id
and lastName
?
Thanks
Sean
Grace Kelly
33,990 PointsHmm, that's strange it works for me, although i've noticed i've made an error on the spelling of userName:
var userName = id.toUpperCase(); //changed spelling error here
userName = userName + '#' + lastName.toUpperCase();
Sean Flanagan
33,235 PointsHi Grace.
Just to let you it worked. Thanks for your help and you've earned a Best Answer for your troubles.
Sean :-)
Grace Kelly
33,990 PointsNo worries Sean, glad I could help!! sorry for the error on my part, just goes to show even the smallest things can trip us up :s haha!!