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

please explain to me what AM I doing wrong ?

app.js
let firstName = 'Khatia';
let lastName = 'Bagaturia';
let role = 'developer';

let fisrtName = "Carlos";
let lastName = "Salgado";
let role = 'developer';

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

4 Answers

Heidi Fryzell
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 Points

Hi Khatia,

I think you just got confused by the directions.

The directions said to create a new variable named msg that combines the firstName, lastName and role variables to create a string like "Carlos Salgado: developer".

But the output should have your name. I think you got confused by the "Carlos Salgado: developer". So you ended up declaring all the variables two times. If you just do it once with your first and last name, this should work:

let firstName = 'Khatia';
let lastName = 'Bagaturia';
let role = 'developer';

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

Hope this helps. Happy coding!

Heidi

thanks ! now I know whats up :D

But I did wrote exactly like that still can not read

Heidi Fryzell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 Points

The code I posted above will pass task 1 and 2 of the challenge. Are you having a problem with one of those or with task 3 where you need to make the role output in uppercase?

Sean Bowden
Sean Bowden
1,896 Points

Hi Heidi, I'm having trouble with task 3 converting the role output in upper case. This is what I have. Can you help? let firstName = ("Sean"); let lastName = ("Bowden"); let role = 'developer' let roleUpper = "role.toUpperCase()"; var msg = firstName + ' ' + lastName + ":" + roleUpper + ".";