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 trialTim McKyer
10,989 PointsAssign an all uppercase version of the id to the userName Variable
Having a little trouble here can anyone help me out #stuck
var id = "23188xtr";
var lastName = "Smith";
var userName = 'id.toUppercase() + userName.toUppercase() ' ;
var userName
<!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>
3 Answers
Hugo Paz
15,622 PointsHi Timothy,
The challenge asks you to assign an all uppercase id to userName.
So you need to use the toUpperCase() method on the variable id.
Like so:
var userName = id.toUpperCase();
Arturo Espinoza
9,181 PointsI don't think the wording on this one is right. It confused me so much. I see your answers but I still don't understand what its asking. I kinda knew what it was asking so I took an educated guess with var userName = id.toUpperCase(); and it was correct.
Dave McFarland
Treehouse TeacherThe problem is in this line:
var userName = 'id.toUppercase() + userName.toUppercase() ' ;
You shouldn't put quote marks around id.toUppercase() + userName.toUppercase()
Also you don't need to re-declare the variable -- var userName
-- in the last line.
Tim McKyer
10,989 PointsThanks for the help, but i just retyped the code without the quote marks and i didn't re-declare the var userName line and it still did not work.
Dave McFarland
Treehouse TeacherSorry. Didn't read this closely enough: Hugo Paz has the answer!