Visit Mozilla.org

Core JavaScript 1.5 Reference:Global Objects:Boolean:valueOf

From MDC


Contents

[edit] Summary

Returns the primitive value of a Boolean object.

Method of Boolean
Implemented in: JavaScript 1.1
ECMA Version: ECMA-262

[edit] Syntax

valueOf()

[edit] Parameters

None.

[edit] Description

The valueOf method of Boolean returns the primitive value of a Boolean object or literal Boolean as a Boolean data type.

This method is usually called internally by JavaScript and not explicitly in code.

[edit] Examples

[edit] Example: Using valueOf

x = new Boolean();
myVar = x.valueOf()      //assigns false to myVar

[edit] See Also

Object.valueOf