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 trialDeondra Olden
2,749 PointsSTUCK, again! How do I add a # to username followed by all uppercase version of lastName variable? Thanks, in advance.
STUCK, again! How do I add a # to username followed by all uppercase version of lastName variable? Thanks, in advance.
var passphrase = id console.log (passphrase.to uppercase());
var id = "23188xtr";
var lastName = "Smith";
var userName
var passphrase = id
console.log (passphrase.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>
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! I think you're probably doing well because you made it past the first step. In this step we're going to take the id and make it upper case (which you already did) and we're going to take the last name and upper case it as well. Now those two parts are identical. What's missing is the pound sign/hash tag in the center. And we do this by concatenating the two different uppercase parts with a pound sign in the center. Take a look at how I did it and see if it makes sense:
var userName = id.toUpperCase() + "#" + lastName.toUpperCase();
Jeff Wilton
16,646 PointsYou can combine strings with the + operator, so the userName var can be constructed in one line like this:
var userName = (id + '#' + lastName).toUpperCase();
James Gill
Courses Plus Student 34,936 PointsIn theory, that should work. But for this exercise, you need to explicitly upperCase both variables separately.