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

Kevin Jervis
Kevin Jervis
2,600 Points

Not sure what I'm doing wrong

Still getting "Task 1 is no longer pasing " message

app.js
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = id + "#";
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>
Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

On a side note: the reason you received a "Task <number> is no longer passing" is because you introduced a syntax error into your code. As Jonathan Grieve notes, += is valid, but =+ is not. This produces a syntax error and your code can no longer be interpreted.

:bulb: If you receive one of these errors, the best idea is to try running your code in the browser console. It's handy for locating and narrowing down syntax errors. :sparkles:

Kevin Jervis
Kevin Jervis
2,600 Points

Apologies for the late reply Jennifer. Thank you for the heads up. Much appreciated :o)

3 Answers

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Kevin,

Right away I saw an error with your += combinator, but you can finish the challenge with just one more line of code.

All you need to do is concatenate everything together using the + operator. Like so.

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

See, it goes on one line because the firstName and lastName variables are passed to userName with the only other change of toUpperCase() being added to the string. So you only need use "username" once

Good luck!

Kevin Jervis
Kevin Jervis
2,600 Points

Hi Jonathan Sorry for the late reply. Thanks for you help, This makes sense now :o)

Rhys Kearns
Rhys Kearns
4,976 Points

Don't post another one when you have one open. I tried to help you ignored it - What is the question that Treehouse is asking.

Kevin Jervis
Kevin Jervis
2,600 Points

Hi Rhys

Sorry for the late reply. Thanks for your help. I did respond. However next time will include a bit more info to give you some context.

Rhys Kearns
Rhys Kearns
4,976 Points
[Moderator redacted]

Did it in two seconds - read the question and WATCH the videos through properly it all makes sense

Michael Hulet
Michael Hulet
47,913 Points

Hi Rhys,

For future reference, it's frowned upon in the Community to post answers that can be copied and pasted into a challenge and pass it without edits that isn't accompanied by an explanation of why it works. I've redacted your code here accordingly. If you wish, you may re-post it with a thorough explanation of why it's the correct answer.

Also, I know your intentions are good, but please try to be less judgmental and demeaning of your other students. Posting in the Community comes with the expectation that you be excellent to everyone you encounter, and any harshness -- no matter how well-intentioned -- won't be tolerated around here.

Thanks for helping out around the Community!

Rhys Kearns
Rhys Kearns
4,976 Points

Sorry posted on his other post twice trying to help but he decided to ignore it and make another post.