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

Michelle Dobbs
Michelle Dobbs
581 Points

How Do I Return the Value Requested?

For this challenge question I was commanded to do the following:

Finally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "23188XTR#SMITH".

This is what I came up with as I was not sure how to write what was asked in the form that was required.

var id = "#23188xtr";
var lastName = "Smith";

var userName = id + lastName.toUpperCase();

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

My answer was incorrect. This is the message that I received;

Bummer: The `userName` variable is "#23188xtrSMITH" not "23188XTR#SMITH".   

How do I return the correct variable? I am lost.

```app.js
var id = "#23188xtr";
var lastName = "Smith";

var userName = id + lastName.toUpperCase();
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>

3 Answers

I too, am having the same problem. The issue is, the question is worded that the solution will be "23188XTR#SMITH." Everything is uppercase. However, after inserting the code, the error message comes up saying that it's supposed to be "23188xtr#SMITH." So now, "xtr" isn't supposed to be uppercase. There isn't consistency here with the question.

KRIS NIKOLAISEN
PRO
KRIS NIKOLAISEN
Pro Student 44,341 Points

You are missing parentheses after id.toUpperCase.

Michelle Dobbs
Michelle Dobbs
581 Points

The question above did not post correctly. Please bare with me as I am new and this is my first time posting a question.

Using String Methods Challenge Task #2

What I have entered in:

var id = "23188xtr";
var lastName = "Smith";

var userName = id.toUpperCase + "#" + lastName.toUpperCase();```

Bummer: The `userName` variable is "function () { spyList.push(method); object[method]._isCalled = object[method]._isCalled + 1 || 1; object[method]._args = object[method]._args || []; object[method]._args.push(Array.prototype.slice.call(arguments)); if(typeof proxy === 'function') { return proxy.apply(this, arguments); } else { throw "`" + method + "` is not a method. Did you mean `" + correctMethod + "`?"; } }#SMITH" not "23188XTR#SMITH".



Thanks for any assistance in advance.