Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript Object constructor Property

Specifies the function that creates an object.

Syntax: JScript Object constructor Property

object.constructor

Arguments: JScript Object constructor Property

object

The name of an object or function.

Remarks: JScript Object constructor Property

The constructor property is a member of the prototype of every object that has a prototype. This includes all intrinsic JScript objects except the Global and Math objects. The constructor property contains a reference to the function that constructs instances of that particular object. For example:

x = new String("Hi");

if (x.constructor == String)

// Do something (the condition will be true). 

or

function MyFunc {

// Body of function.

}

 

y = new MyFunc;

if (y.constructor == MyFunc)

// Do something (the condition will be true). 

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.