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 trial

JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables Using String Methods

Jack Christie
Jack Christie
186 Points

Convert a string to uppercase letters

var id = "23188xtr"; var lastName = "Smith";

The question asks me to convert the ID and name to all uppercase letters.

var userName = lastName + id.toUpperCase(); // This is what I typed in, but it keeps telling me it's not the answer.

app.js
var id = "23188xtr";
var lastName = "Smith";

var userName = lastName + id.toUpperCase();
index.html
<!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>
Jack Christie
Jack Christie
186 Points

Thanks. I will try that. Been busy with school. I am taking JavaScript in school too.

1 Answer

Steven Parker
Steven Parker
231,269 Points

Are you on task 1 or 2? If I remember correctly, task 1 is just id, so "lastName" shouldn't be there.

And if it's task2, the id needs to come before the last name, the last name also needs to be upper-cased, and there should be a "#" symbol in between them.