JavaScript JavaScript Basics (Retired) Storing and Tracking Information with Variables Using String Methods

Erick Hernandez
Erick Hernandez
827 Points

How can i correct this I'm having trouble "toUppercase'.

var id = "23188xtr";
var lastName = "Smith";
var userName = id;
var word = "ID";
var shout = word.toUppercase();
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script src="app.js"></script>

2 Answers

Victor Mercier
Victor Mercier
10,565 Points

Hi, try this code:

var word = "ID";
var res = word.toUpperCase();
Steven Parker
Steven Parker
186,462 Points

It's not the name "ID" that the challenge is asking you to convert. It's the contents of the id variable. So you won't need to create "word" or "shout".

Just use the toUppercase() method directly on the id variable, and assign the result to userName.