August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.length
The length property of an instance of the String object returns the total length of the string.
Listing 6.243 creates three instances of the String object. The length property of each of these instances are accessed and written to the user's page.
<script language="JavaScript"> <!–– Hide // Create an instance of the String object var myString1 = new String("Hello, World"); var myString2 = new String("Here is a longer string"); var myString3 = new String("Here is an even longer string"); // Write the lengths of these strings to the ... |
Read now
Unlock full access