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

How do I pass this question without invalidating the first task?

I can't remember how to add strings and i don't know what i am doing wrong

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

var userName = id.toUpperCase();
userName += '#' + lastName.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>

4 Answers

Jesus Mendoza
Jesus Mendoza
23,289 Points

Hey Jonathan,

Try concatenating the string in one line

Steven Parker
Steven Parker
231,007 Points

It could be done on one line. But it doesn't need to be.

Steven Parker
Steven Parker
231,007 Points

:point_right: You spelled "toUppercase" (the second time) with a lower-case "c".

It needs to be "toUpperCase", as you wrote it the first time.

Just a little typo. Otherwise, you got it. :+1:

Dor Sarel
Dor Sarel
9,987 Points

Hi,

first of all - you are adding strings in the right way! :) the problem with your code is when making the lastName variable uppercase you forgot to capital the letter "c" in the word case. toUppercase() ==> toUpperCase();

Hoped i helped.

It was in fact the capital letter 'C' thanks guys !!!