Microsoft® JScript
new Statement
See Also
Language Reference 


Description

Creates a new object.

Syntax

new constructor

The new statement syntax has this part:

Part Description
constructor

A call to the object's constructor. The parentheses for the function call can be omitted if the constructor takes no arguments.

Remarks
The new statement performs the following tasks:
  1. It creates an object with no members.
  2. It calls the constructor for that object, passing a pointer to the newly created object as the this pointer.
  3. It initializes the object according to the arguments passed to the constructor.
These are all examples of valid uses of the new statement:

my_object = new Object;
my_array = new Array();
my_date = new Date("Jan 5 1996");

© 1996 by Microsoft Corporation.


Casa de Bender