August 1999
Intermediate to advanced
1488 pages
72h 53m
English
string.valueOf()
The valueOf() method returns the primitive value of the object. In terms of an instance of a String object, this method returns the string itself.
In Listing 6.261, an instance of the String object is created. Since the valueOf() method returns the actual value of the string, "Here is some random text" is written to the user's page.
<script language="JavaScript1.1"> <!–– Hide // Create an instance of the String object var myString = new String("Here is some random text."); // Write the value of the string to the page. document.write('The ... |
Read now
Unlock full access