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

I dont understand what I'm doing wrong.

I've tried with the console log but no matter what I code, it's wrong. I am a little lost as to what it's asking me exactly.

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

var userName= 'id.toUpperCase()');
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="app.js"></script>

2 Answers

Halvard Bastiansen
Halvard Bastiansen
Data Analysis Techdegree Student 14,886 Points

You are very close. Just remove the " " around both id.toUpperCase().

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

var userName= id.toUpperCase(); console.log(userName.toUpperCase());

Adam Beer
Adam Beer
11,314 Points

You are near. First, inside the userName, delete the apostrophes and the closing bracket. Second, rewrite your whole code into the userName. Third, don't use console.log() method, unnecessary, did not ask from you the challenge. Like this, the first task solution,

var userName= id.toUpperCase();

When you use numbers, boolean values or methods, you can't use apostrophes, you can use only for strings and symbols. Please check Strings and values in JavaScript.

Hope this help.

Adam Beer
Adam Beer
11,314 Points


var userName= 'id.toUpperCase()');
SyntaxError: Unexpected token )

If you delete the closing bracket, the output is,


You have been converted the console.log() content to string.

If you delete the apostophes,

var userName= id.toUpperCase();

the output is,


I think you should start using the Visual Studio Code. This is a code editor. The beginning is difficult to use, if you understand the editor it will help a lot.