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

Hey, am not sure what is wrong with this code. Am to add the uppercase to role. Does anybody know what am doing wrong?

app.js
let firstName='Paul';
let lastName='Kavuma';
let role = 'developer';
let msg = firstName + ' ' + lastName + ' ' + ':' + role.toUpperCase() + '.';

1 Answer

Mark Ryan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mark Ryan
Python Web Development Techdegree Graduate 28,648 Points

Hi, Paul!

You're close! You'll want your output to look exactly like this:

Paul Kavuma: DEVELOPER

There should be 2 spaces and 0 periods. Check back if that doesn't help!

Thank you very much, it worked.

Angelica Islas
Angelica Islas
4,082 Points

I am stuck with the same problem. I wrote: let msg= firstName + ' ' + lastName: ' ' +role.toUppercase(); Would you be able to help me, Mark Ryan? Thanks.

Mark Ryan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Mark Ryan
Python Web Development Techdegree Graduate 28,648 Points

Hi, Angelica!

Of course I can help!

You're referencing lastName: which has a colon on the end resulting in unexpected token. Also, toUppercase() is not a String method, you'll need to use toUpperCase().

Your code:

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

Try doing:

let msg = firstName + ' ' + lastName + ': ' + role.toUpperCase();
Angelica Islas
Angelica Islas
4,082 Points

Thanks for your help, Mark Ryan!