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

msg = firstName + ' ' + lastName + ':' + role ; I used this line of code to try to input the : sign and was incorrect

app.js
let firstName = ("Everett");
let lastName = ("Harris");
let role = 'developer';
msg =  firstName + ' ' + lastName + ':' + role ;

1 Answer

Hi Everett!

For some reason, this challenge trips up a lot of people.

They are correct when they point out to be very careful about having your spacing exact!

This passes task 1:

let firstName = 'Everett';
let lastName = 'Harris';

This passes task 2:

let firstName = 'Everett';
let lastName = 'Harris';
let role = 'developer';
let msg =  firstName + ' ' + lastName + ': ' + role; // declare msg with let
// (and make sure to use use colon + space between lastName and role)

This passes task 3:

let firstName = 'Everett';
let lastName = 'Harris';
let role = 'developer';
let msg =  firstName + ' ' + lastName + ': ' + role.toUpperCase();

Note: the last line could also be constructed like this (using template literal syntax):

 let msg =  `${firstName} ${lastName}: ${role.toUpperCase()}`; // also passes

Note: template literals must be surrounded by backticks (that's this: ` not ' nor " )

(The backtick is the key above the tab key and to the left of the 1/! key and its uppercase character is the Tilda: ~ )

I hope that helps.

Stay safe and happy coding!

Thanks Peter!! I feel a little stupid after seeing the answer was something so simple. I would have never guessed to use that space in that spot. Starting to understand why people quit coding, small simple errors can cause serious headaches.