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

Not exactly sure where I'm going wrong here

I'm looking at my notes and thought I was plugging in the commands properly but I guess not. Is there anyone who can assist?

app.js
const name = prompt"firstName";
let message =  Kamran + "lastName" + Hussain;
let role = 'developer';

Hi Kamran,

Lots to unpack here, but great effort! Here are my thoughts:

  1. Prompt is actually not needed to complete the challenge.
  2. Let's look at your message variable. If you enter this as is into the console, it will throw an error because Kamran and Hussain are being treated as variables instead of strings. You want to use firstName and lastName in the message variable. You don't want to retype your full name. For example:
let firstName = "Spongebob"; 
let lastName = "Squarepants"; 
let msg = firstName + " " + lastName; // If logged to the console, this will read: Spongebob Squarepants 

Hope this helps!

1 Answer

Think I'm gonna need another option. It's giving me trouble using your method