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 trialJoseph Hookham
2,493 PointsTask 3 / 3 - Can't convert role to uppercase.
Hi, I've tried lots of variations but it won't recognise 'role' as a variable and the modifier won't act on it. Thanks.
let firstName = "Joe";
let lastName = "Hookham";
let role = 'developer';
let msg = firstName + ' ' + lastName + ': ' + role;
var upper = role.toUpperCase;
Rick Gleitz
47,878 PointsBihari, your answer won't quite work all by itself. In addition, you would need to place the 'var upper' line above the 'let msg' line and change '+ role' at the end of 'let msg' to '+ upper'
3 Answers
Rick Gleitz
47,878 PointsGet rid of the let upper line and change the end of the let msg line to read: + role.toUpperCase();
Joseph Hookham
2,493 PointsThat's the one, thanks!
Rick Gleitz
47,878 PointsYou don't need a new variable, just put .toUpperCase() onto the end of role in your msg variable. Hope this helps!
Joseph Hookham
2,493 PointsThanks for the replies. I still can't get it to work.
I've tried it like this:
let firstName = "Joe"; let lastName = "Hookham"; let role = 'developer'; let role.toUpperCase(); let msg = firstName + ' ' + lastName + ': ' + role;
And
let firstName = "Joe"; let lastName = "Hookham"; let role.toUpperCase() = 'developer'; let msg = firstName + ' ' + lastName + ': ' + role;
And
let firstName = "Joe"; let lastName = "Hookham"; let role = 'developer'; let upper = role.toUpperCase(); let msg = firstName + ' ' + lastName + ': ' + role;
Joseph Hookham
2,493 PointsOh that didn't format how I imagined... hope it still makes sense.
Bihari Sharma
Front End Web Development Techdegree Student 235 PointsBihari Sharma
Front End Web Development Techdegree Student 235 Pointshey joseph u are dping right but only mistake u had done right but after.toUpperCase() add circular brackets to define that it is a method