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 need help with the second task of this lesson I can't understand the questione very well

Can anybody Help me by explaining the question?

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>

3 Answers

Alexandra Barnett
.a{fill-rule:evenodd;}techdegree seal-36
Alexandra Barnett
Front End Web Development Techdegree Graduate 46,473 Points

Hi Abdulrahman! The second task wants you to add more to the username variable. Firstly it wants you to add a hash symbol and then add the surname (lastName variable) to the string in uppercase. You are concatenating the string. I have put the code below to help you but, let me know if you have any questions :)

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

var userName = id.toUpperCase() + '#' + lastName.toUpperCase();
Andrew Young
Andrew Young
Courses Plus Student 639 Points

Hey Alexandra would you be likely to change the script rendering to js change the line to ```js to be more comfortable to view the syntax highlighting thanks :)

Greg Kaleka
Greg Kaleka
39,021 Points

Alexandra, great answer! Just to expand on Andrew's suggestion: if you add the language after your backtics, you'll get syntax highlighting. I took the liberty of doing so for you. You can edit your answer to see it. Looks like this, though:




You can do this with HTML, CSS, PHP, Python, SQL... pretty much all the languages taught here on treehouse.

Thanks for participating, and happy coding!

Cheers :beers:


thanks for your support,

thank you all for your support :)