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 assist, I've rewatched the videos and I still don't understand how to complete question 3 of the challenge.

combine and manipulate strings

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

1 Answer

Hey Jay,

So your msg is currently not using your values from your firstName/lastName variables, instead you are just inputting the strings instead of your LET variables. Sorry if this explanation sounds strange, here is my working example:

let firstName = "Ian"; let lastName = "Cahn"; let role = "developer"; let msg = firstName + " " + lastName + ": " + role.toUpperCase();

The best way for me was to put my code against working code, and see where i made mistakes in my coding efforts. Let me know if this makes sense, otherwise i can explain on discord.

ok I appreciate it, but the second challenge for firstname lastname let me continue with the code i wrote for firstname and last name, just really stuck on making it uppercase, but you may have answered my question so thanks in advance

// This line of yours let msg = "jay " + "kang: " + "developer";

// Should be using your firstName and lastName variables, instead of strings like "jay" let msg = firstName + " " + lastName + ": " + role;

Glad i could help matey.

Good luck and keep going!