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

Cant get my concatenation to work

I've tried to get the code to work but something is not right. See Below:

app.js
let firstName = 'Anthony';
let lastName = 'Smith';
let role = 'developer';
let msg = firstName + lastName + role + "Carlos Salgado: developer ";

Hey Anthony, It is asking you to form a sting like "Carlos Salgado: developer" So in your case the msg will read out "Anthony Smith: developer" If you delete the + "Carlos Salgado: developer" on the end your sting will not have spaces so you will need to add them that looks like this

let msg = firstName + ' ' + lastName + ': ' + role

inbetween the first and last name I added a space then after the last name that adds a : then a space. on the next step it will ask you to use the toUpperCase method so then add .toUpperCase() to the role the final code should look like this

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

I hope this helps

3 Answers

let firstName = "Emmanuel"; let lastName = "Oyedeji"; let role = 'developer'; // the value of shout is DEVELOPER let shout = role.toUpperCase(); const msg= firstName + " " + lastNam

let firstName = 'Carlos'; let lastName = 'Salgado'; let role = 'developer';

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

I don't know what's wrong here.

let firstName = 'Chloe';

let lastName = 'Lee';

let role = 'developer';

// the value of 'shout is "DEVELOPER"

const shout = role.toUpperCase();

let msg = firstName + " " + lastName + ": " + shout;

I was stuck on this one for a sec too. Hope that helps!

Shawn Butts
Shawn Butts
3,271 Points

I was stuck on the last part for a good while, thank you so much Chloe.