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 trialdaphnee jeune
2,183 PointsI 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()');
console.log('userName.toUpperCase()');
<!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
Halvard Bastiansen
Data Analysis Techdegree Student 14,886 PointsYou 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
11,314 PointsYou 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
11,314 Points//Output
var userName= 'id.toUpperCase()');
^
SyntaxError: Unexpected token )
If you delete the closing bracket, the output is,
userName.toUpperCase()
You have been converted the console.log() content to string.
If you delete the apostophes,
var userName= id.toUpperCase();
console.log(userName.toUpperCase());
the output is,
23188XTR
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.