JavaScript JavaScript Basics Storing and Tracking Information with Variables Using String Methods

Obe Juarez
Obe Juarez
3,305 Points

Why is my code wrong?

Yes i know ... this is way off lol . Whats the correct answer cause im i cant figure it out .

var id = "23188xtr";
var lastName = "Smith";
var pound = '#';
var userName = (id.toUpperCase());
id + pound + lastNAme;
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="app.js"></script>

2 Answers

36,505 Points

Hi Obe,

You're pretty close. Try dropping the pound variable and keep all of your code on the userName variable line. Then add the pound sign as a string and the lastName variable. You can add the lastName variable the same way you added the id variable in Step 1.


Kuanyshbek Ospanov
Kuanyshbek Ospanov
11,986 Points

Hello man, i think I'm too late, but there is an answer of your question

var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase() + "#" + lastName.toUpperCase();