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 trialleyla herrera
1,691 Pointscombining 2 strings. var userName = id.toUpperCase(); userName += "#"; I need to add var lastName. How I do it?
Understanding adding strings but I can't complete this challenge.
Var id = "23188xtr"; var lastName= "smith"
var userName= ??.toUpperCase(); userName += "#";
Answer= 23188XTR#SMITH
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName += "#";
<!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
Clayton Perszyk
Treehouse Moderator 48,850 PointsYou need to add lastName - all uppercased - after the hash sign.
leyla herrera
1,691 PointsThank you! Yikes! I I kept adding the +=.
Victoria Theriot
2,123 PointsVictoria Theriot
2,123 PointsIt's still not working for me. :(
Here is my code:
var lastName = "Smith";
var userName = id.toUpperCase()
userName += '#SMITH';
Any advice??
Clayton Perszyk
Treehouse Moderator 48,850 PointsClayton Perszyk
Treehouse Moderator 48,850 PointsVictoria Theriot not sure why; I copied and pasted your code and it passed.