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 trial

JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

having trouble figuring this one out, it says, Finally, convert the string stored in role to uppercase letters.

Finally, convert the string stored in role to uppercase letters. The final msg string should look similar to this: "Carl

app.js
let firstName ="Kyle";
let lastName ="Long";
let role = 'developer'.toUppercase();
let msg = firstName + " " + lastName + ": " + role;

8 Answers

Rick Gleitz
Rick Gleitz
47,878 Points

No, the role.toUpperCase() should be down in the let msg part, not in the let role part. And remember: it's role.toUpperCase() not role.toUppercase(). Both the U and the C need to be capitals.

ooooooic, yeah i seee now. thank you so much

Rick Gleitz
Rick Gleitz
47,878 Points

Hi Kyle, The .toUpperCase() method gets attached to the role variable in your msg concatenation, not at the end of the variable declaration. Make sure that the 'c' in the method you have is a capital C.

Hope this helps.

thank you Rick!

so its role.toUppercase(); = 'developer'? how should i attach it to role?

Hi Kyle,

You did everything correct except for not camel casing the method toUpperCase() as it should be. Below is how your code runs in the console when you want to see what msg is:

let firstName ="Kyle"; let lastName ="Long"; let role = 'developer'.toUpperCase(); let msg = firstName + " " + lastName + ": " + role; undefined msg "Kyle Long: DEVELOPER"

Rick Gleitz
Rick Gleitz
47,878 Points

Hi Mark,

With the hint, I think they were trying to show you another example of how to do .toUpperCase() or something like that. Don't worry about that.

But the error message did say not to modify the original string stored in role. The modification goes down in the let msg line. First of all, delete the concatenation of the period at the end of that line. It's outside the string the challenge wants. Next, put a space after the colon (so it will separate your name from the word developer). Finally, attach the .toUpperCase() method to the end of role in the concatenation rather than as you did up above where role was defined.

Hope this helps!

Mark Anderson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mark Anderson
UX Design Techdegree Graduate 16,092 Points

I'm stuck on this problem. I attempted what read here ( though not entirely sure that I understood it.)

let firstName = "Mark"; let lastName = "Anderson"; let role = 'developer'.toUpperCase(); let msg = firstName + " " + lastName + ":" + role + ".";

received this message - Bummer: The original string stored in role should not be modified.

The hint is- const word = "javascript";

// the value of 'shout' is "JAVASCRIPT" const shout = word.toUpperCase();

This is confusing to me because I don't grasp why the value shout is used. But this is closer to the video where he used a variable but he also used the console.log as well.

Mark Anderson
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mark Anderson
UX Design Techdegree Graduate 16,092 Points

Rick,

Thank you for the tips. I was able to finish up the quiz. I have a slightly better understanding of the details now. Thank you!

Thank you, Rick! I was also struggling with this question, but this helped me figure it out.