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 trialBartlomiej Pajak
5,063 PointsCould you give me some feedback? I'll be grateful
Here's my code: https://w.trhou.se/yfgts9zc9p
Thank you for any suggestions!
1 Answer
Steven Parker
231,172 PointsAs 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!
Bartlomiej Pajak
5,063 PointsThanks for your answer!
Armin Kadic
16,242 PointsArmin Kadic
16,242 PointsI'm no expert but it looks good to me! The only thing that I would change maybe is instead of doing this:
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!