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

et firstName = "james"; let lastName = "swenson"; let role = 'developer'; let msg = firstName + ' ' + lastName + ':' + r

Can anyone help me with this. I'm trying to convert "role" to to.UpperCase

app.js
let firstName = "james";
let lastName = "swenson";
let role = 'developer';
let msg = firstName + ' ' + lastName + ':' + role.toUpperCase() + '.';

3 Answers

Rick Gleitz
Rick Gleitz
47,415 Points

Hi James,

You basically have it, just two small things to make it pass the checker. One: don't concatenate the period at the end. The period was just to end the sentence in the instructions. Two: Inside the string where you add the colon, put a space after the colon. That's it. Hope this helps!

Hello James, you might find it useful to use a template literal to avoid confusion when concatenating strings and spaces. It is important to note that you use backticks (`) and not single quotation marks (' ') when creating a template literal. Example: let msg = ${firstName} ${lastName}: ${role.toUpperCase()} `

Thanks for the inputs. Your solution worked great on this Rick, and I'll take your advice in the future Alonzo.