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 trialIleana Dell'Unti
2,282 Pointsi receive the message of the page with the complete sentence write well but the keeps saying that # symbol is not there!
don't understand : (
var id = "23188xtr";
var lastName = "Smith";
var userName = id+'#'+lastName.toUpperCase();
alert (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>
5 Answers
Ayoub AIT IKEN
12,314 PointsHey ! You have to call the uppercase method in both cariables, ( Id + lastname )
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase()+"#"+lastName.toUpperCase();
Ileana Dell'Unti
2,282 Pointsthanks so Much :) !!!
Ayoub AIT IKEN
12,314 PointsYou most welcome :)
Ileana Dell'Unti
2,282 Pointsso it's just + with variables, so when do I use += ?
Ayoub AIT IKEN
12,314 Pointsthe "+=" is used when you want to increment the same variable by choosen number, given exemple :
var i = 10;
i += 10; // this is the equivalent sentence to this i = i + 10;
alert(i); // this will give you 20 as result, since i had 10 as value at the begning and then we added an other 10 to it.
it is used as a shorthand !
Ileana Dell'Unti
2,282 Pointsthanks!! get a bit confuse some times :P