August 1999
Intermediate to advanced
1488 pages
72h 53m
English
boolean.valueOf()
The valueOf() method returns the primitive value of the object. In terms of an instance of a Boolean object, this method returns a Boolean value contained in the object.
Listing 6.67 creates a Boolean object representing true. Because the valueOf() method returns the Boolean value in the object, "true" is written to the browser.
<script language="JavaScript"> <!–– Hide //Create a Boolean object representing true bool = new Boolean(1); //Display the source of the Boolean object document.write(bool.valueOf()); // End hide ... |
Read now
Unlock full access