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

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

app.js
let firstName = "Saroosh";
let lastName = "Sajid";
let role = 'developer';

let msg = firstName + ' '  + lastName +  " Carlos Salgado: " + role;

 const change = role.toUpperCase() );
console.log(msg);

5 Answers

Instead of trying to create a new variable in the line const change = role.toUpperCase() );, try changing the end of your msg string from role; to role.toUpperCase();. You only need one opening and closing parenthesis for the function.

While the challenge asks you to create a string like "Carlos Salgado: developer" or "Carlos Salgado: DEVELOPER", you don't need to include the string "Carlos Salgado" in your msg, just the same type of format, with ":" and spacing.

Sabari Sawant
seal-mask
.a{fill-rule:evenodd;}techdegree
Sabari Sawant
Front End Web Development Techdegree Student 1,084 Points

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

thank you jb30 that helped me!!

Ethan Gonzalez
Ethan Gonzalez
4,984 Points

I too am stuck on the problem and cant figure it out. Below is the current code i have written:

let firstName = "yoyo";

let lastName = "froyo";

let role = "developer";

let msg = firstName + ' ' + lastName + ':' + role.toUpperCase () + '.';

The error says: Bummer: Use the .toUpperCase() method to convert the role string to all upper-case.

Try removing the + '.' from the end and adding a space after the :

I just do not understand this last task, I've watched the video a few times over and still can not figure out how to code it. I don't want to just skip over it. What is the answer to the last task so I can study how it is written? I've looked at the previous answers but cannot grasp it. Thanks.

Javi Caballero
Javi Caballero
7,422 Points

you're supposed to write role.toUpperCase (); at the end of the msg string instead of just role.