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 trialAaron Jones
637 PointsI don't know what to do?
Finally, add a # symbol and lastName in uppercase to the end of the userName string. the final value of userName is "23188XTR#SMITH".
This is the question that it asked me and i don't know what to do so some help would be great thank you!
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase("#" + 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>
4 Answers
ALFRED MOHENU
1,499 PointsThe statement is asking you to convert the id and lastName to uppercase and add # to it. This is known as concatenation. The error with your code is,
- You have not converted the lastName to uppercase.
- You are adding "#" and uppercase as arguments toUpperCase() and this is wrong.
To get the desired answer which is "23188XTR#SMITH", your code will have to look like something like this.
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase() + "#" + lastName.toUpperCase();
Chris Loyd
1,272 PointsYou have the concatenation of # and lastName as input to your toUpperCase method, which isn't going to work. It should look like this:
var userName = id.toUpperCase() + '#' + lastName.toUpperCase();
Aaron Jones
637 PointsFor some reason the answers that you guys game me still isn't write it says that my answer for the first question is now invalid.
Chris Loyd
1,272 PointsCan you try resetting the exercise?
Aaron Jones
637 PointsI figured it out thank you though.