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 trialJeremiah Johnson
2,167 PointsIs it frustrating on purpose?
I can't figure out the syntax the lesson is looking for. We are supposed to string id and lastName together with a # between the id and lastName and the whole thing is supposed to be in all caps. For some reason no matter how I write it the # is not recognized. What is the trick because I can not figure it out by watching the video or looking through the MDN JavaScript reference page.
var id = "23188xtr";
var lastName = "Smith";
var userName = id + "#" + lastName.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>
3 Answers
William Li
Courses Plus Student 26,868 PointsYou didn't upcase the id
var userName = id.toUpperCase() + "#" + lastName.toUpperCase();
Hugo Paz
15,622 PointsHi Jeremiah,
You are supposed to have the id in caps too.
So you need to change your code to:
var userName = id.toUpperCase() + "#" + lastName.toUpperCase();
This is why its giving you an error on the #.
Jeremiah Johnson
2,167 PointsThank you everyone for all the help! As I get farther on it just keeps getting a little tougher.
Jeremiah Johnson
2,167 PointsJeremiah Johnson
2,167 PointsI will try this, I was adding it all in one command then ending it .toUpperCase.
Hugo Paz
15,622 PointsHugo Paz
15,622 PointsIf you want to call the method only once you can do it like so:
var userName = (id + "#" + lastName).toUpperCase();
William Li
Courses Plus Student 26,868 PointsWilliam Li
Courses Plus Student 26,868 Points+1, yeah, that works too