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

let newRole = role.toUpperCase(); For some reason this isn't working, anyone else have this problem?

I've done the previous two, but for some reason the third checkpoint isn't working.

app.js
let firstName = "Adam";
let lastName = "Johnson";
let role = 'developer';
let msg = firstName + " " + lastName + ":" + role + ":";
let newRole = role.toUpperCase();

Hi Adam! All you need to do in the msg variable is do a role.toUpperCase() and it should be fine. The newRole variable is not necessary.

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

4 Answers

Martin Balon
Martin Balon
43,651 Points

Hi Adam, You don't have to declare new variable newRole - all you have to do is to use method toUpperCase on var role inside the msg variable. Look at the code below - I'm joing all variables in to one string and using toUpperCase method at the same time.

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

I've tried that too, but it keeps saying I need to use the .toUpperCase() method. I think there's a bug in the system. I've tried to move on but it keeps bringing me back to this problem saying I need to solve it.

Martin Balon
Martin Balon
43,651 Points

Hi Adam, the code above passes the challenge. If you want you can post your current code so I can tell you whether there's any typo.

Thanks Martin! I simply copied your code onto mine, and it passed. I have no idea what the difference maker was as our codes were identical.

Daniela Valdez
Daniela Valdez
188 Points

Thanks for asking this question, Adam. I had the same issue with this today. For some reason, I kept getting (error) even when the code was exactly the same as the one Martin posted.