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

could I get some help with challenge 3. pls,

combine and manipulate strings

app.js
let firstName = "jay";
let lastName = "kang";
let role = 'developer';
let msg = "jay " +  "kang: " + "developer";

let firstName = "Ian"; let lastName = "Cahn"; let role = "developer"; let msg = "Ian " + "Cahn: " + "developer";

This works in challenge 2 of 3. It shouldn't

it should be what I explained in your previous question dude.

Go read the question at the top again.

ok so again mr. ian im past question 2 0f 3 and need help with 3 to uppercase. my coding worked for question 2 of 3 ive passed that question and do not need to change what i have written. so...

1 Answer

Cameron Childres
Cameron Childres
11,820 Points

Hi Jaylyn,

The goal of this challenge is to use variables to construct a string. The way you've built your message uses the values of the variables themselves and while that will allow you to pass the 2nd stage it will cause problems on the 3rd. You need to use the variable names as placeholders for the text. For the 2nd stage this would look like:

let firstName = "jay";
let lastName = "kang";
let role = "developer";
let msg = firstName + " " + lastName + ": " + role;

From here you can add the toUpperCase() method on to role on the last line to take care of stage 3.

I hope this helps! Let me know if you have any questions.