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

Anica Bell
PLUS
Anica Bell
Courses Plus Student 3,004 Points

1 Null? and Space concantenation

I keep receiving the error that I need to concatenate one space between firstName and lastName. I've finally gotten past the challenge with the code below but it doesn't make any sense to me at this time. Can someone please explain to me why the space is surrounded by ' ' on its own while the colon is attached to the role variable? Thanks in advance!

let firstName = "anica"; let lastName = "smith"; let role = "developer";

let msg = firstName + ' ' + lastName + ':role';

app.js
let firstName = "anica";
let lastName = "bell";
let role = "developer";

let msg = firstName + ' ' + lastName + ':' + role; 

console.log(msg);

2 Answers

having the same issue

Heidi Fryzell
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 25,178 Points

Hi Anica,

The challenges are very picky and you have to get every character exactly right for it to pass. 🙄

Try putting a space after the colon. Like this

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

Happy Coding!