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

David Corrales
David Corrales
4,698 Points

I'm stumped is there anyway you can ask the question differently?

I'm stumped is there anyway you can ask the question differently?

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

var id = id.toUpperCase();


var userName = 'idlastName'

console.log(userName.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>

1 Answer

Otec Perez Glass
Otec Perez Glass
7,678 Points

David Corrales Hope you are doing well

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

var userName = id.toUpperCase();
userName = userName + '#' + lastName.toUpperCase();
/*
fisrt ? Use the JavaScript .toUpperCase( ) string method to assign an all uppercase version of 
the id variable to the userName variable.

Second? Finally, add a # symbol and lastName in uppercase to the end of the userName
 string.  The final value of userName is "23188XTR#SMITH".

1 What is really is asking you is to assign the convertion on the UpperCase to id 
Also i will like to point out that you already declared the variable id with var id at the 
top of the program if you are trying to delcare that again will give you a bug if you where 
declaring that in a function with its own block scope that will be fine, but is not the case 
on your code

2 So then is asking you that the userName variable should cointain besides its own value, 
a '#' which we can use the + symbol or concatenation to  add information, then we add the 
uppercase of lastname which result will be lastName.toUpperCase(); 
*/

Hopefully that will help you.