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 Introducing Strings Review

Raquel King
Raquel King
172 Points

String Values

Complete this code by adding the string property that returns the number of characters inside the string:

"Good morning students!". ___;

I do not understand how to complete this code. How do i add the string property to return the number of characters?

1 Answer

Hi Raquel,

The property to use is .length, this is already available to use in JavaScript, so you do not need to create it yourself, you just need to know the property name to use.

You can try it out further here - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/length#try_it