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 trialodysseywow
2,783 PointsHow to convert only Developer to uppercase
Finally, convert the string stored in role to uppercase letters. The final msg string should look similar to this: "Carl
let firstName = "Anthony";
let lastName = "Gunsch";
let role = 'developer';
let msg = firstName + ' ' + lastName + " : " + role;
3 Answers
Peter Vann
36,427 PointsHi!
You're so close!
Lose the space before the :
And then just add .toUpperCase() to role (to pass task #3).
This passes all three tasks:
let firstName = "Anthony";
let lastName = "Gunsch";
let role = 'developer';
let msg = firstName + ' ' + lastName + ": " + role.toUpperCase();
// Alt Solution (which will also pass) using template literal syntax
// let msg = `${firstName} ${lastName}: ${role.toUpperCase()}`;
// Don't forget the surrounding backticks!
More info:
https://www.w3schools.com/jsref/jsref_touppercase.asp
I hope that helps.
Stay safe and happy coding!
Peter Vann
36,427 PointsCan you send me your exact code?
Lee Samuels
678 Pointslet firstName = 'Lee'; let lastName = 'Samuels'; let role = 'developer'; let msg = '${Lee} ${Samuels}: ${developer.toUpperCase()};
Peter Vann
36,427 PointsHi Lee!
After seeing your code, it's clear what the problems are.
First of all, the challenge is about using variables, so use them in the msg string.
Next, since you are attempting to use template literal syntax, you need to surround your string with backticks, not quotes.
Backticks are the lowercase character above the tab key and to the left of the 1/! key. (The uppercase of the same key is the tilda character: ~
Therefore, your last line should be:
let msg = `${firstName} ${lastName}: ${role.toUpperCase()}`; // Note: ` is neither ' nor "
I hope that helps.
Stay safe and happy coding!
Jesse Gonzalez
7,322 Pointsthis challenge is the first one that gave me so much problems. the 3rd question stumped me.
Lee Samuels
678 PointsLee Samuels
678 PointsWhen I follow what you say it tells me to make sure I'm concatenating ':' to lastName and role. What am I doing wrong? Please help.
Alonzo Delk
6,991 PointsAlonzo Delk
6,991 PointsThank you and I feel like I need to go through this whole variable upperCase session again!