JavaScript length Property
JavaScript String object
Definition and Usage
The length property returns the length of a string (number of characters).
Syntax
string
.length
Browser support





All major browsers support the length property.
Example
Example
Return the number of characters in a string:
The output of the above example is:
12
Try it »
JavaScript String object