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

You've only taught how to transform lower case to upper case in console.log but not 100% fully change it..

You've only taught how to transform lower case to upper case in console.log but not 100% fully change it permanently..

app.js
let firstName = 'Peter';
let lastName = 'Huang';
let role = 'developer';


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

1 Answer

Shao Yo Huang, what you've submitted does in fact change the value of role to uppercase from then on in your script. If you wanted to utilize this new value place const msg below the change of role.toUpperCase();. You can even drop the let from the second role because you have already added role as a variable and you're simply modifying its value.

let firstName = 'Peter';
let lastName = 'Huang';
let role = 'developer';

role = role.toUpperCase();
const msg = firstName + " " + lastName + " : " + role;