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 trialLevente Bito
4,679 PointsUse the JavaScript .toUpperCase( ) string method to assign an all uppercase version of the id variable to the userName v
Use the JavaScript .toUpperCase( ) string method to assign an all uppercase version of the id variable to the userName variable.
var id = "23188xtr";
var lastName = "Smith";
doument.write(id.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>
5 Answers
Grace Ji
5,402 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName = id.toUpperCase();
This should work. :) Don't worry about to make lastName into uppercase.
Jennifer Nordell
Treehouse TeacherHi Levente! You're so close here that I'm just going to give some hints. You are doing the id.toUpperCase()
part correctly. However, you are writing it to the document, which wasn't asked for by the challenge. The challenge asks for that part to be the value assigned to the variable userName
.
I think you can get it from just these hints, but let me know if you're still stuck!
Antonio Nogueras
1,307 PointsI am also stuck. Here's what I have:
var id = "23188xtr";
var lastName = "Smith";
var userName = id + lastName;
userName.toUpperCase();
It won't allow this for some reason. I realize I might be doing more than what is asked, but the error messages suggest otherwise.
Faiz hamdan
1,648 Points<p>I'm stuck at this for two days makes me hungry</p> '''hmtl var id = "23188xtr"; var lastName = 'Smith";
var userName (id.toUpeercase()); '''
Tori Sims
7,298 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName = (id.toUpperCase());
Tori Sims
7,298 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName = (id.toUpperCase());
This should help.
sukumar ui developer
Courses Plus Student 218 Pointsvar id = "23188xtr"; var lastName = "Smith";
var userName=(id.toUpperCase()); console.log(userName); console.log(userName.toUpperCase());
STEVEN PENA
13,928 PointsSTEVEN PENA
13,928 Pointsam struck in the same spot