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 trialJack Edmonds
2,466 Pointswhy dose it say task 1 is no longer passing
I did what it said to do and it says task 1 is no longer passing
var id = "23188xtr";
var lastName = "Smith";
+
var userName = '23188XTR#SMITH'.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>
2 Answers
Matheus Ferraresi
12,476 PointsBecause the first task is asking you to assign the function .toUpperCase() on the var id value and you are not doing it, you just had assigned the final value to the var userName.
The task 1 ask you to use .toUpperCase() on the id var and assign that value to the var userName, so:
var userName = id.toUpperCase();
And the task 2 ask you to add an "#" plus the value of the var lastName, so this would be the final right answer:
var userName = id.toUpperCase() + "#" + lastName;
Hope that I've made you understand.
Steven Parker
231,275 PointsYou do have a bit of work yet to complete the challenge, but to answer your question:
The "+" sign by itself on line 3 is causing a syntax error, and since a syntax error invalidates the whole script it detects it as an issue when retesting the earlier task.