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

Bartlomiej Pajak
Bartlomiej Pajak
5,063 Points

Could you give me some feedback? I'll be grateful

Here's my code: https://w.trhou.se/yfgts9zc9p

Thank you for any suggestions!

Armin Kadic
Armin Kadic
16,242 Points

I'm no expert but it looks good to me! The only thing that I would change maybe is instead of doing this:

var message = "The string " + fullName;
message += " is " + characters + " characters long.";

You can do this:

var message = "The string " + fullName + " is " + characters + " characters long.";

It works one way or another, the choice is yours!

Good job!

1 Answer

Steven Parker
Steven Parker
231,172 Points

As Armin pointed out, there's always multiple ways to achieve the same result. For example, you could skip the creation of the "characters" and "message" variables entirely:

alert(`The string ${fullName} is ${fullName.length} characters long.`);

But the important thing is having a grasp on the material presented so far, and you seem to be off to a good start.
Happy coding!