Return the number of characters in a string:
The result of n will be:
The length property returns the length of a string (number of characters).
The length of an empty string is 0.
Property | |||||
---|---|---|---|---|---|
length | Yes | Yes | Yes | Yes | Yes |
Return Value: | The length of a string |
---|---|
JavaScript Version: | 1.0 |