Name

String.length — the length of a string

Synopsis

string.length

Description

The String.length property is a read-only integer that indicates the number of characters in the specified string. For any string s, the index of the last character is s .length−1. The length property of a string is not enumerated by a for/in loop and may not be deleted with the delete operator.

Get JavaScript: The Definitive Guide, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.