Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

length Property (String) (JavaScript)

Returns the length of a String object.

strVariable.length
"String Literal".length 

The length property contains an integer that indicates the number of characters in the String object. The last character in the String object has an index of length - 1.

Supported in the following document modes: Quirks, Internet Explorer 6 standards, Internet Explorer 7 standards, Internet Explorer 8 standards, Internet Explorer 9 standards. See Version Information.

Applies To: String Object (JavaScript)

Community Additions

Show:
© 2015 Microsoft