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

convert string "role" to all upper-case using .toUpperCase()

I did exactly as it is instructing me to do. the error that i am getting is " use the ' .toUpperCase();'

app.js
let firstName = "Riley";
let lastName = "Weishaupt";
let role = 'developer';
const msg = firstName + ' ' + lastName + ":" + role.toUpperCase() + ".";

1 Answer

Luc de Brouwer
seal-mask
.a{fill-rule:evenodd;}techdegree
Luc de Brouwer
Full Stack JavaScript Techdegree Student 17,939 Points

Hi Riley,

You were almost there. If you pay close attention to the sentence you weren't told to explicitly include a dot in the end, so if you remove the + "." in your sequence, the challenge will pass. Also, I wouldn't recommend using const for these particular string concatenations, as later on in coding challenges or the javascript stack data needs to be modified, and const won't allow you to modify its original data once it's created. If you would turn it into a third let variable this will be much less error-prone :).

Well done

Thank you so much! So what I ended up having to do was: let msg = 'firstName' + " " + 'lastName' + ":" + 'role.toUpperCase';