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 trialDimitrios Kavadas
2,942 PointsI can't seem to find the answer even after entering the code which should work.
var id = "23188xtr"; var lastName = "Smith"; var userName = id.toUpperCase(); userName += "#" lastName.toUpperCase();
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName += "#" 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>
1 Answer
Antonio English
Front End Web Development Techdegree Graduate 18,103 Pointsvar id = "23188xtr"; var lastName = "#Smith"; var userName = id.toUpperCase();
var userName = id.toUpperCase() + lastName.toUpperCase();
Dimitrios Kavadas
2,942 PointsDimitrios Kavadas
2,942 PointsThank you Antonio. Any reason why my code wouldn't work? except for the lack of + between the "#" and the lastName.toUpperCase ?
Antonio English
Front End Web Development Techdegree Graduate 18,103 PointsAntonio English
Front End Web Development Techdegree Graduate 18,103 Pointsmy apologies
you can do it your way too. just add + after "#" to successfully concatenate
userName += "#" + lastName.toUpperCase();