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

Ricky Redman
Ricky Redman
7,520 Points

having difficulty assing the command toUpperCase to the id var to userName

What am i not understanding from the objective?

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

var userName(id.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>

2 Answers

Steven Parker
Steven Parker
231,275 Points

To put a value into a variable, you use the assignment operator ("="). This goes between the variable name and the value you want to give it (instead of enclosing the value in parentheses).

Parentheses are used to pass arguments to functions,.

Also, you wrote "toUppercase" (with a little "c") instead of "toUpperCase" (capital "C").

Bruno Leal Guimaraes
Bruno Leal Guimaraes
1,907 Points

Chase the text's colors on your app.js and you will find out 2 details missing. As a beginner as well I can say that the SyntaxError is the most often mistake we make. Good tip is use the Develop Tools (Ctrl+Shift+I on chrome) to open the JavaScript on your browser, it will help you to find out why your code isnt running properly.