Finally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "231
var id = "23188xtr"; var lastName = "Smith"; var userName= "string"
Ryan DudleyTreehouse Project Reviewer
Hello Langelihle Chimanya! Hopefully I can help clear this up and get you on your way.
Currently, you are setting the
userName variable to a string literal that holds the value of "string". However, the challenge wants you to use the
toUpperCase() method on the
id variable, and store that information in
.toUpperCase( ) string method to assign an all uppercase version of the id variable to the userName variable. We can accomplish this like so:
var userName = id.toUpperCase(); // userName now holds the value of '23188XTR'
toUpperCase() method is saying, convert the string contained within
id to all uppercase and store the resulting string in the
Step 2: Finally, add a # symbol and lastName in uppercase to the end of the userName string. The final value of userName is "23188XTR#SMITH". There are a few different ways you could combine these strings, in this example I will just use the
+ operators to concatenate the desired strings to the end of the
userName variable like so:
userName += '#' + lastName.toUpperCase(); // userName now holds the desired '23188XTR#SMITH' string.
In the above example, the
+= operator is saying add
# + lastName.toUpperCase() to the value already contained within our
userName variable. This means that the
userName variable now holds the desired string of
I hope this was able to help you out, and if you are still unclear on how this works or need additional help do not hesitate to ask!