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

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,515 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
17,416 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();