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 trial

JavaScript JavaScript Basics Working with Strings Combine and Manipulate Strings

Susanna Clough
seal-mask
.a{fill-rule:evenodd;}techdegree
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 Points

Converting a word to Uppercase in a string

It looks correct to me but I keep getting an error. Please help!

app.js
let firstName = 'Susanna';
let lastName = 'Clough';
let role = 'developer';
const msg = firstName + ' ' + lastName + ':' + role.toUpperCase() + '.' ;

3 Answers

Hey, 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

I 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
seal-mask
.a{fill-rule:evenodd;}techdegree
Susanna Clough
Full Stack JavaScript Techdegree Student 1,678 Points

I 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.

I 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!