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 trialsarosh sajid
Courses Plus Student 153 PointsFinally, convert the string stored in role to uppercase letters. The final msg string should look similar to this: "Carl
let firstName = "Saroosh";
let lastName = "Sajid";
let role = 'developer';
let msg = firstName + ' ' + lastName + " Carlos Salgado: " + role;
const change = role.toUpperCase() );
console.log(msg);
5 Answers
jb30
44,807 PointsInstead of trying to create a new variable in the line const change = role.toUpperCase() );
, try changing the end of your msg
string from role;
to role.toUpperCase();
. You only need one opening and closing parenthesis for the function.
While the challenge asks you to create a string like "Carlos Salgado: developer" or "Carlos Salgado: DEVELOPER", you don't need to include the string "Carlos Salgado" in your msg
, just the same type of format, with ":" and spacing.
Sabari Sawant
Front End Web Development Techdegree Student 1,084 Pointslet firstName="Sabari"; let lastName="Sawant"; let role.toUpperCase() = "developer"; let msg = firstName +' ' +lastName + ':' + role;
Bleek Wehba
1,033 Pointsthank you jb30 that helped me!!
Ethan Gonzalez
4,984 PointsI too am stuck on the problem and cant figure it out. Below is the current code i have written:
let firstName = "yoyo";
let lastName = "froyo";
let role = "developer";
let msg = firstName + ' ' + lastName + ':' + role.toUpperCase () + '.';
The error says:
Bummer: Use the .toUpperCase()
method to convert the role
string to all upper-case.
jb30
44,807 PointsTry removing the + '.'
from the end and adding a space after the :
Cornelius Duna
307 PointsI just do not understand this last task, I've watched the video a few times over and still can not figure out how to code it. I don't want to just skip over it. What is the answer to the last task so I can study how it is written? I've looked at the previous answers but cannot grasp it. Thanks.
Javi Caballero
7,422 Pointsyou're supposed to write role.toUpperCase (); at the end of the msg string instead of just role.