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

Israel Imru
Israel Imru
5,297 Points

Bug in quiz? It keeps telling me that my (correct answer) is not that same as (correct answer).

I can easily just skip this (and I have), but whenever I click "Resume Track" it brings me back here because it's unresolved. My code spits out the correct answer, but it's not letting me submit it. I'm assuming I may have done it differently than they'd like. Can somebody point me in the right direction?

app.js
var id = "23188xtr";
var lastName = "Smith";
id.toUpperCase();
var userName = id.toUpperCase() + "#" + lastName.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>

2 Answers

Israel, you are so close!! I tried your solution in the Challenge, and although it didn't mind the

id.toUpperCase();

in the first task, it doesn't like it in the second. As it happens, you don't need this line at all. The results of this method call just get thrown away, as you don't print it, or assign it to a variable, or use it as a parameter in another method call, etc. Calling it twice, as you do in the next line is all that's needed, as the results there are concatenated and assigned to userName. In short, all you need is this:

var userName = id.toUpperCase() + "#" + lastName.toUpperCase();
Israel Imru
Israel Imru
5,297 Points

Oh, you're right. I feel silly.

Thanks!

We've all been there!!