Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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 23,385 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!