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

this looks good but im missing something, can anyone help?

app.js
let firstName = "Adrian";
let lastName = "Storr";
let role = 'developer';
const msg = firstName + lastName + 'developer' + '.';

4 Answers

Simon Coates
Simon Coates
8,377 Points

You're missing the semi-colon and it doesn't require the "." at the end. It probably wants you to consume the role variable in the concatenation operator (+role).

Hi Adrian! -

You're wanting your string to say: "Adrian Storr: developer". It's important to remember spacing when using the + in concatenation.

If you code:

const msg = firstName + lastName;

you are going to get: "AdrianStorr" as a result. To fix this, we need to add several + to the above code.

const msg = firstName + " " + lastName + ": " + role;

... should do the trick for you.

how do i uppercase developer??

can i get help here plz!

Simon Coates
Simon Coates
8,377 Points

it accepts:

let firstName = "Name";
let lastName = "Von LastName";
let role = 'developer';
let msg = `${firstName} ${lastName}: ${role.toUpperCase()}`; 

but you could achieve a similar result for the msg using string concatenation (if they haven't covered the backtick syntax and string interpolation). So the last line in that instance might resemble:

let msg = firstName+ " "+lastName + ": "+role.toUpperCase();

how im i still getting it wrong it says : Bummer: Cannot read property '1' of null.