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

Finally, convert the string stored in role to uppercase letters. The final msg string should look similar to this:

app.js
let firstName = "Carlos";
let lastName = "Salgado";
let role = 'developer';

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

there is something wrong, it keeps saying I need to use the .toUpperCase() method, this is the reason why I tend to unsubscribe to this way of learning due to errors in creating this. if anyone can help please, feel free to chime in.

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

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

Hello James , I don't you should unsubscribe to this form of learning ,...

I have been battling with the code myself for over 24hrs and decided to bring it online and stumbled on this community , then i saw a code from someone review your own code and immediately it clicked

So i think where the issues is , You need to change your let msg to a constant

From my understanding , They wanted you to run a logging program whereby users can always logging at all times ,

So by default the browser wont know carlos before hand ... So setting Firstname to Const and lastname to Const will be the best way to declare such variable , Since they wont change overtime ...

Well all i can say is programming demands constant research , So always make google a go to resource

See you ontop.

6 Answers

Martin Balon
Martin Balon
43,651 Points

Hi James,

I think you added dot at the end of the sentence plus there is missing empty space between colon and role. Look at this code:

let firstName = 'Donald';
let lastName = 'Trump';
let role = 'developer';

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

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

I've played around with this code and it just doesn't work for me. I've tried it on a console, and it prints out okay.

Martin Balon
Martin Balon
43,651 Points

James the code you just posted will result in the following sentence: CarlosSalgado:DEVELOPER:

but the challenge expects the following as correct answer:

Carlos Salgado: DEVELOPER

There's no colon after word developer and there are two empty spaces - one between first and last name and second right after colon.

Look at my answer above and notice the empty spaces and the colon with empty space between lastName and role.

This is it I have been struggling with this code for an hour...thanks, Martin!!!! Mo

Emerson French
seal-mask
.a{fill-rule:evenodd;}techdegree
Emerson French
Front End Web Development Techdegree Student 4,125 Points

This is what I got After banging my head against the wall lol. let firstName = "john"; let lastName = "doe"; let role = 'developer'; let msg = firstName +' '+ lastName +': '+ role.toUpperCase(); Make sure you add space between first name and last and space after the colon, you should be good after that. I just figured out that, what you see on the message is what they want. "Read carefully".

no one else has this problem, apparently I'm the only one with this particular discussion. there are no discussion on solutions .

Hello James , I had the same issues.

Let me fix it for you through your code

Also pay attention to the quotation marks " " or ' '

Hello, This is what worked for me. Wish I loaded the image, sorry. Blessings.

let firstName = "Mau"; let lastName "Hernandez"; let role "developer; let msg = firstName + + lastName + ": + role.toUpperCase( ".");

let firstName = 'kooool'; let lastName = 'miomio'; let role= 'developer'; let role1 = role.toUpperCase();

let msg = ${firstName} ${lastName}: ${role1};

let firstName = 'kooool'; let lastName = 'miomio'; let role= 'developer'; let role1 = role.toUpperCase();

let msg = (${firstName} ${lastName}: ${role1});