Microsoft® JScript™ new Statement |
| Language Reference | | Version 1 | |
Creates a new object.
new constructor
The constructor argument is a call to the object's constructor. The parentheses for the function call can be omitted if the constructor takes no arguments.
The new statement performs the following tasks:These are all examples of valid uses of the new statement:
- It creates an object with no members.
- It calls the constructor for that object, passing a pointer to the newly created object as the this pointer.
- It initializes the object according to the arguments passed to the constructor.
my_object = new Object; my_array = new Array(); my_date = new Date("Jan 5 1996");
© 1997 Microsoft Corporation. All rights reserved. |