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 trialsophiajackson
6,642 Pointswhat is wrong here? let msg = firstName + " " lastName + ": " + role.toUpperCase();
let firstName = "Sophia";
let lastName = "Jackson";
let role = 'developer';
let msg = firstName + " " + lastName + ": " + role;
let msg = firstName + " " lastName + ": " + role.toUpperCase();
2 Answers
Peter Vann
36,427 PointsHi Sophia!
For the second task, just add .toUpperCase to role on the fourth line.
The tests don't generally like repeating lines of code, in other words.
Like this (task 1):
let firstName = "Sophia";
let lastName = "Jackson";
let role = 'developer';
let msg = firstName + " " + lastName + ": " + role;
Task 2:
let firstName = "Sophia";
let lastName = "Jackson";
let role = 'developer';
let msg = firstName + " " + lastName + ": " + role.toUpperCase();
You could do this also:
let msg = `${firstName} ${lastName}: ${role.toUpperCase()}`; // using a template literal
I hope that helps.
Stay safe and happy coding!
Peter Vann
36,427 PointsSorry, I just noticed I left off the second backtick in my template literal example, but I just fixed it!?! (Don't tell anybody!?! LOL)
sophiajackson
6,642 Pointssophiajackson
6,642 Pointsyes thank you!!