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 trialKevin Jervis
2,600 PointsNot sure what I'm doing wrong
Still getting "Task 1 is no longer pasing " message
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = id + "#";
userName =+ lastName.toUpperCase();
<!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>
Kevin Jervis
2,600 PointsApologies for the late reply Jennifer. Thank you for the heads up. Much appreciated :o)
3 Answers
Jonathan Grieve
Treehouse Moderator 91,253 PointsHi 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
2,600 PointsHi Jonathan Sorry for the late reply. Thanks for you help, This makes sense now :o)
Jonathan Grieve
Treehouse Moderator 91,253 PointsHi Kevin, great! Glad I could help :)
Rhys Kearns
4,976 PointsDon'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
2,600 PointsHi 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
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
47,913 PointsHi 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
4,976 PointsSorry posted on his other post twice trying to help but he decided to ignore it and make another post.
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherOn 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.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.