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

What does it mean when it says task 1 is no longer passing? I don't understand this question.

None

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

Marie Nipper
Marie Nipper
22,638 Points

Hey Emily! You're super close. You've already declared username once so don't declare it again. Your third line is perfectly correct.

var username = id.toUpperCase();

But, it's messing up when you redeclare the username on line 5. At any rate, you can do task 2 a couple of different ways. You have all of the elements of a correct answer. I don't want to give it away. But, if you properly mix the 4th and 5th line of code you've got it.

To at least give you a hint:

var userName = id.toUpperCase();
userName += 'something goes here' + somethingGoesHere.method();

And good luck. You're going to have multiple points in which you want to flip your table, throw you computer, or bang your head. Ask for help or take a walk, but don't give up. Good luck and hope this helped!

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi Justin! I took the liberty of changing your comment to an "Answer" to allow for voting and possible selection of Best Answer. Thanks for helping out in the Community! :sparkles:

Robbie Thomas
Robbie Thomas
31,093 Points

I had some troubles with this myself coming back to it, wondering how I did it.

Here you go:

var id = "23188xtr".toUpperCase();
var lastName = "Smith".toUpperCase();
var userName = id += "#" + lastName