Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

James Swenson
James Swenson
523 Points

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
45,207 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!

Alonzo Ledesma
seal-mask
.a{fill-rule:evenodd;}techdegree
Alonzo Ledesma
Full Stack JavaScript Techdegree Student 3,949 Points

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()} `

James Swenson
James Swenson
523 Points

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