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

MacKenzie Santiago
MacKenzie Santiago
5,137 Points

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

I give up! WUTS Wrong?!

app.js
let firstName = "MacKenzie";
let lastName = "Santiago";
let role = 'developer';
let msg = firstName + " " + lastName +":" + role.toUpperCase() + ".";

4 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, MacKenzie Santiago! You're doing fantastic and you are incredibly close. No reason to give up.

If I were to run this and use console.log(msg); to print the string, I would get back:

'MacKenzie Santiago:DEVELOPER.'

But it's looking for:

'MacKenzie Santiago: DEVELOPER'

Note that the second one has a space after the colon and no period/full stop on the end. So instead of using just a colon without a space after ":" try a ": " and put the extra space needed directly in that string. Then on the end, remove the + ".".

Hope this helps! :sparkles:

MacKenzie Santiago
MacKenzie Santiago
5,137 Points

Awww......They threw a knuckle ball in there! Thank you!

MacKenzie Santiago
MacKenzie Santiago
5,137 Points

I did what you asked me to do EXACTLY. It still did not pass.............

Hi, Why don't you pass it with the new ES6 syntax template literal syntax? It worked perfectly for me.

let msg = `${firstName} ${lastName}: ${role.toUpperCase()}`;
MacKenzie Santiago
MacKenzie Santiago
5,137 Points

Im sure you are correct but it wasnt part of the lesson plan for this assignment, like it is for the next assignment.

Or, Do as the lady explained above.

let firstName = "MacKenzie";
let lastName = "Santiago";
let role = 'developer';
let msg = firstName + " " + lastName + ": " + role.toUpperCase();

It worked perfectly as well. :D

MacKenzie Santiago
MacKenzie Santiago
5,137 Points

ok sorry it passed...........I forgot to take away the "." at the end