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 trialJames Chhun
2,347 PointsFinally, convert the string stored in role to uppercase letters. The final msg string should look similar to this:
let firstName = "Carlos";
let lastName = "Salgado";
let role = 'developer';
let msg = firstName +' '+ lastName +':'+ role.toUpperCase()+'.';
Olayinka Ajibabi
507 Pointslet firstName = "Carlos"; let lastName = "Salgado"; let role = 'developer';
const msg = firstName + ' ' + lastName + ': ' + role.toUpperCase();
Olayinka Ajibabi
507 PointsHello 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
43,651 PointsHi 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();
James Chhun
2,347 Pointslet firstName = "Carlos"; let lastName = "Salgado"; let role = 'developer'; let msg = firstName +' '+ lastName +':'+role.toUpperCase()+':';
James Chhun
2,347 PointsI'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
43,651 PointsJames 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.
Monique Succeed
5,474 PointsThis is it I have been struggling with this code for an hour...thanks, Martin!!!! Mo
Emerson French
Front End Web Development Techdegree Student 4,125 PointsThis 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".
James Chhun
2,347 Pointsno one else has this problem, apparently I'm the only one with this particular discussion. there are no discussion on solutions .
Olayinka Ajibabi
507 PointsHello James , I had the same issues.
Let me fix it for you through your code
Paul HILL
1,895 PointsAlso pay attention to the quotation marks " " or ' '
Mauricio Hernandez
7,208 PointsHello, 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( ".");
Kavitha Mahesawarappa Sujatha
9,066 Pointslet firstName = 'kooool'; let lastName = 'miomio'; let role= 'developer'; let role1 = role.toUpperCase();
let msg = ${firstName} ${lastName}: ${role1}
;
Kavitha Mahesawarappa Sujatha
9,066 Pointslet firstName = 'kooool'; let lastName = 'miomio'; let role= 'developer'; let role1 = role.toUpperCase();
let msg = (${firstName} ${lastName}: ${role1}
);
James Chhun
2,347 PointsJames Chhun
2,347 Pointsthere 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.