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 trialKelly Strosser
3,173 PointsI am having the hardest time with this seemingly simple code challenge.
I've tried so many different ideas with no results.
var id = "23188xtr";
var lastName = "Smith";
id.toUpperCase ();
lastName.toUpperCase ();
var userName = id + '#'+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>
1 Answer
Joe Purdy
23,237 PointsIt looks like you haven't changed the value assigned to the id
and lastName
variables on lines 3 and 4. For instance:
var a = "foo";
console.log(a.toUpperCase()); // FOO
console.log(a); // foo
// Reassign new value to a
a = a.toUpperCase();
console.log(a); // FOO
So you're on the right path, but you need to assign the result of calling the String.toUpperCase() method back to the variables in question in order to have the change stick for future uses of that variable.
Hope that helps! I'd be glad to help out more if not.