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

Kayla Howard
Kayla Howard
4,655 Points

How do I convert a string stored in a variable to .ToUpperCase

I'm on step 3 of 3 in the string manipulation challenge.

Kayla Howard
Kayla Howard
4,655 Points

I was finally able to copy and the code. My work is listed below. I receivedthis message. "Bummer: Use the .toUpperCase() method to convert the role string to all upper-case."

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

3 Answers

variable.toUpperCase();

Kayla Howard
Kayla Howard
4,655 Points

Thank you so much for taking the time to reply :) I sincerely appreciate it! I did it exactly the same way and got this message.. "Bummer: Use the .toUpperCase() method to convert the role string to all upper-case.
"

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

  1. You were supposed to add the toUpperCase() method to the role variable from the previous step.
  2. There should be a space after the colon, and there shouldn't be a period at the end.
Kayla Howard
Kayla Howard
4,655 Points

Tried what you described and I'm still stuck :( Would you please demonstrate how you are saying to do it? Thank you so much for your help!!

let msg = firstName + " " + lastName + ": " + role.toUpperCase();
Kayla Howard
Kayla Howard
4,655 Points

Oh my Gosh!! Thanks so much!! I wasn't adding the space after the colon... I though I was, as it turns out I didn't. I'm working off my phone, so sometimes it auto corrects what I type.