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 trialAli Sh
2,026 PointsHELP ME WITH THE ANSWER!!!
What is the function is used to apply the toUpperCase method? when to use the app.js and when to use index.html?
var id = "23188xtr";
var lastName = "Smith";
var userName = id;
console.log(userName.toUpperCae());
<!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
Robert Anthony
19,952 PointstoUpperCase()
You have missed out the 's' in Case. You also need to assign the uppercase version to userName. At the moment, you are storing the normal id and then logging an uppercase version. Convert to uppercase and store it in username.
Timothy Harrington Bourne
6,372 Pointsvar id = "23188xtr";
var lastName = "#Smith";
var userName = id + lastName
document.write(userName.toUpperCase())
Robert Anthony
19,952 PointsThis is the final answer: First you convert the id to uppercase and store it in userName (That's the first part of the problem). Then you add the '#' to the userName and the lastname converted to upper case.
var id = "23188xtr";
var lastName = "Smith";
var userName = id.toUpperCase();
userName = userName + '#' + lastName.toUpperCase();
You were changing the lastName (not allowed) and not storing the uppercase versions in userName (not what was asked). They don't want to to log the result or display it to the document, just store it.