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 .

app.js
var id = "23188xtr";
var lastName = "Smith";
var pound = '#';
var userName = (id.toUpperCase());
id + pound + lastNAme;
index.html
<!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

joelearner
joelearner
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.

Cheers!

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();