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

Please help. I don't understand what this question is asking in the JS code.

This question is asking me to Assign an all uppcase version of the id variable to the userName variable

app.js
var id = "23188xtr";
var lastName = "Smith";

var userName
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>

2 Answers

LaToya Legemah
LaToya Legemah
12,600 Points

What you need to do is declare the variable which is username. Then put that equal to the id variable. Then make that uppercase.


var userName= id.toUpperCase();

Extra info can be found here: http://www.w3schools.com/jsref/jsref_toUpperCase.asp

Got it. Thanks.

Steven Parker
Steven Parker
231,269 Points

A string has already been assigned to the id variable.

There's a JavaScript function that converts text to uppercase. They want you to apply that function to id, and then put the result into userName.

Steven, I understand that it's asking me to add the JS .toUpperCase but I don't really understand how to do it within this question. I'm looking for someone to help walk me through this code challenge question.