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 trialRaedawn Long
6,943 PointsHello, needing help with this code, I feel like is right but I am stuck with my quotes at some point
Wondering where I am missing quotes I think its right keep getting error message
var id = "23188xtr";
var lastName = "Smith";
var userName "=" id.toUpperCase (); "+" "=" "#lastName".toUpperCase (); "=" "23188XTR#SMITH".
<!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
Otec Perez Glass
7,678 PointsRaedawn Long Hello Hope you are doing well That is your code
var id = "23188xtr";
var lastName = "Smith";
var userName "=" id.toUpperCase (); "+" "=" "#lastName".toUpperCase (); "=" "23188XTR#SMITH".
You are almost there, but just remember that the equal_operator is use for assignment ( = ) so it should not be on quote marks and also the (+) symbol is us for concatenation so When is used on strings, the + operator is called the concatenation operator or to combine strings, so is not only an operator for addition.
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = userName + '#' + lastName.toUpperCase();
Raedawn Long
6,943 PointsGreat! Thank you!
Otec Perez Glass
7,678 PointsAlways.