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 trialfelixnicol
1,876 PointsWhat is wrong with this syntax? It is not accepting it and coming up with errors.
let firstName = 'Felix';
let lastName = 'Nicol';
let role = 'developer';
let msg = firstName + ' ' + lastName + ':' + role + '.';
let newMsg = role.toUpperCase();
1 Answer
Ali .
15,521 PointsYou almost correct, the question says just convert role variable to with toUpperCase() method., and didn't mention about a new variable like 'let newMsg'
let firstName = 'Felix';
let lastName = 'Nicol';
let role = 'developer';
let msg = firstName + ' ' + lastName + ': ' + role.toUpperCase();
felixnicol
1,876 Pointsfelixnicol
1,876 PointsMan thanks so much. I could not figure out what I was doing wrong. Lifesaver! cheers
Ali .
15,521 PointsAli .
15,521 PointsYou can do like this
let msg = ` ${firstName} ${lastName} : ${role.toUpperCase()}`;
Its call ' Template literals '