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 trialSusanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsConverting a word to Uppercase in a string
It looks correct to me but I keep getting an error. Please help!
let firstName = 'Susanna';
let lastName = 'Clough';
let role = 'developer';
const msg = firstName + ' ' + lastName + ':' + role.toUpperCase() + '.' ;
3 Answers
Helari Sosi
6,168 PointsHey, In my opinion your solution should work as well. Tested it in borwser too and it worked there.
I think this challenge might be buggy and maybe try to use Template Literals
to complete the challenge. Template literals should come pretty soon after this.
const msg = `${firstName} ${lastName}: ${role.toUpperCase()}.`
If you already don't know about template literals then here's a good source - Template Literals
NATALIE DRYE
Front End Web Development Techdegree Student 11,042 PointsI am having the same issue as above (also tested in the browser and works just fine) and template literals didn't solve the issue. I am not sure what the problem is.
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsI actually finally got it to work. I tried template literals as well and that didn't work. I'm not sure why it finally worked. I tried to report it as a bug but I was told to check with the community. I know it's frustrating but keep trying.
NATALIE DRYE
Front End Web Development Techdegree Student 11,042 PointsI just had my web dev partner look at it and he said I forgot the space after the colon and that I should take the period out at the end...sure enough, I did as advised and it worked just fine. Buggy for sure, it shouldn't have let me get past the 2nd part by adding the period. Anyway, isn't learning fun!
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 PointsIt is very fun and extremely rewarding when my coding goes right!! Glad you figured it out!!