JavaScript - Boolean constructor() Method


Advertisements


Description

Javascript boolean constructor() method returns a reference to the Boolean function that created the instance's prototype.

Syntax

Use the following syntax to create a Boolean constructor() method.

boolean.constructor()

Return Value

Returns the function that created this object's instance.

Example

Try the following example.

<html>
   <head>
      <title>JavaScript constructor() Method</title>
   </head>
   
   <body>
      
      <script type="text/javascript">
         var bool = new Boolean( );
         document.write("bool.constructor() is:"+bool.constructor); 
      </script>
      
   </body>
</html>

Output

bool.constructor() is : function Boolean() { [native code] }

javascript_boolean_object.htm

Advertisements