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

Julian Cubillos
Julian Cubillos
2,060 Points

Use 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.Use the JavaScript .toUpperCase( ) string method to assign an all uppercase version of the id variable to the userName variable.

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

var userName=id.toUpperCase() + "#" + lastName.toUpperCase();
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

Steven Parker
Steven Parker
229,744 Points

Did you get ahead of yourself?

Your solution looks good for task 2, but you described the requirements for task 1. I hope you're not just copying someone else's answer, that's not a good way to learn.

Try writing code that would do only what the task requires.

Julian Cubillos
Julian Cubillos
2,060 Points

I am taking this as part of a class in school and this is what my partner and I came up with, though we cant get pass the first chanllenge

Steven Parker
Steven Parker
229,744 Points

There's no way anyone would create this code based on the task 1 instructions, So your partner must have completed both tasks already to have created this code for task 2. Just ask them to show you (and explain) their task 1 solution.

Or show what you have here to your teacher and see what they say.