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 trialIsrael Cebrian
934 PointsHi. Been trying to convert the string stored in role to uppercase letters.. Please advise.
Hello. Been trying to convert the string stored in role to uppercase letters. Please advise.
let firstName = "Ceb";
let lastName = "Israel";
let role = 'developer';
let msg = firstName + ' ' + lastName + ':' + role + '.';
let msg = firstName + ' ' + lastName + ':' + role.toUpperCase() '.';
3 Answers
seth aruby
10,111 PointsCeb, I just completed this challenge using the code suggested in my previous response, minus the concatenation of the period. If your code looks like this then you will be able to complete it as well since the challenge expects the format of the msg string to be "Carlos Salgado: developer". Also, you can't assign the msg variable two different values using 'let' so you must also take out your first 'let msg' declaration, like the following:
let firstName = "Ceb";
let lastName = "Israel";
let role = "developer";
let msg = firstName + ' ' + lastName + ': ' + role.toUpperCase();
Israel Cebrian
934 Pointsfinally went through. Thank you so much.
Joe Murphy
1,884 Pointsquick question- why did we have to include the period before, but after adding the method to role, we no longer needed it at the end?
seth aruby
10,111 PointsCeb, Your code to convert role to uppercase looks good. I'm not sure what error you're getting but i suspect it is related to a concatenation error in your last line of code:
let msg = firstName + ' ' + lastName + ':' + role.toUpperCase() '.';
should be
let msg = firstName + ' ' + lastName + ':' + role.toUpperCase() + '.';
Israel Cebrian
934 PointsThank you for the response Seth. I tried yours but didn't work.
Richard Luo
4,427 PointsThe answer to your problem is
let msg=firstName+' '+lastName+': '+role.toUpperCase();
You're just missing a empty space after colon (:) and you don't need to include the period (.)
Israel Cebrian
934 PointsThank you for the response Richard. I tried yours but didn't work.
James Ackerman
14,099 PointsJames Ackerman
14,099 PointsTry removing the period after role.toUpperCase();
The following worked for me...
If you look closely at the wording in the code challenge, the period is after the quotations, so they're looking for... Ceb Israel: DEVELOPER