Exploring Strings

How long is a string?

Every string has a length property that tells us how many characters it contains. This property is also accessed using the dot notation we used with the charAt() method. For example, the following code will tell us how many characters are in the string 'Hello' :

Get hands-on with 1200+ tech skills courses.