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 trialKevin Lewis
Front End Web Development Techdegree Student 9,667 PointsDon't understand why this isn't working
Don't know what I'm missing in this statement.
var id = "23188xtr";
var lastName = "Smith";
alert( id .toUpperCase());
var userName
<!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
Aaron Price
5,974 PointsThree things
- you can't have a space between "id" and ".toUpperCase()"
- you need to assign the value of that to the userName variable.
- you don't need an alert
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase()
Christopher Debove
Courses Plus Student 18,373 PointsYou need to affect the result of id.toUpperCase()
to your variable userName :
var userName = id.toUpperCase();
Aaron Price
5,974 PointsWhoops, you're right. I have no idea what I was thinking there.
Christopher Debove
Courses Plus Student 18,373 PointsIt shocked me too at first. I'm used to see line breaks, but not "just" space or tabs here :o
Christopher Debove
Courses Plus Student 18,373 PointsChristopher Debove
Courses Plus Student 18,373 PointsWhitespaces are totally valid, ex: