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

What is the correct answer to this question?

Where am I going wrong with this?

app.js
let firstName = "Callie";
let lastName = "Crownover";
let role = 'developer';
let msg = firstName + " " + lastName + ": " + role;
let shout = role.string.toUpperCase();

4 Answers

almost, let's try role.toUpperCase()

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

Hi Callie,

You can use the toUpperCase() method right on your role variable, so without the .string inbetween. Next you'll have to move your shout variable up above the string concatenation otherwise it won't be specified when the string code runs. At last change the role in your string to shout. Since the role value will still be lowercase and the uppercase is saved to shout.

let firstName = "a";
let lastName = "b";
let role = 'developer';
let shout = role.toUpperCase();

let msg = firstName + " " + lastName + ": " + shout;
Rohald van Merode
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

or just simply add .toUpperCase inside your string...

let msg = firstName + " " + lastName + ": " + role.toUpperCase();
Nicole Antonino
Nicole Antonino
12,834 Points

Mei Lee is right, you use just role.toUpperCase(), but you also don't even need to create that new variable of shout. You can just add the .toUpperCase() to the end of the variable 'role' when concatenating in the msg variable:

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

what is wrong here? still Bummer feedback!

let firstName = "Rogier"; let lastName= "Bogaards"; let role = 'developer';

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

Rohald van Merode
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rohald van Merode
Treehouse Staff

Hey Rogier,

It looks like there's a space missing behind the : with changing that it passed for me. Hope that helps :)