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

I'm not getting an answer to this question because my code looks right, but it cannot read production. I need some help?

app.js
let firstName = "lonzo";
let lastName = "delka";
let role = 'developer';

let firstName = "Carlos";
let lastName = "Salgado";
let role = 'developer';

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

2 Answers

Nick Huemmer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 Points

Hi Alonzo, There's a few things to adjust here to pass this challenge.

  • You're re-declaring the three variables in the - you only need to declare them once, e.g.
let firstName = "lonzo";
let lastName = "delka";
let role = 'developer';

You don't need to declare them more than once for this challenge. You can also declare them like this:

let firstName;
let lastName;
let role = 'developer';

firstName = 'Lonzo';
lastName = 'Delka';
  • You do want to be sure that you're including a colon with a space in the right place ": ".

Keep in mind that the challenges are super-picky and can be frustrating as the feedback is not always the most helpful. One thing you can do is test your code in a tool like JSfiddle and it will help point out some syntactical errors you may have.

Hopefully this helpful! Keep up the good work and you'll get it!

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

Moderator Note: Moved response from "Comment" to "Answer" section so it can be seen as being answered in the Community. Please try to place answers in the Answer section and only use comments for requesting additional information, as comments do not show in Community main page.

Thanks :) :dizzy:
Jason

Thank you