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

EDDY saqchez
EDDY saqchez
635 Points

Use the JavaScript .toUpperCase( ) string method to assign an all uppercase version of the id variable to the userName v

How to 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";
id = "lastName";
var userName = id 5ffm.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

tracydipietro
tracydipietro
3,585 Points

I simply misunderstood the question. I couldn't understand if they were asking to make the entire username uppercase or just id or lastName. Is that just me?

    var id = "23188xtr";
var lastName = "Smith";

var userName = id.toUpperCase()

You were close to it, you just don't put the id value in as id is already holding the value.

Jan Durcak
Jan Durcak
12,662 Points

is it a very bad thing if you fail on such a small mistakes, isnt it better to review the video at least 2/3 times to get it right or just go with next step