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

 

JScript new Operator

Creates a new object.

Syntax: JScript new Operator

new constructor[(arguments)]

Arguments: JScript new Operator

constructor

The constructor argument calls object's constructor. The parentheses can be omitted if the constructor takes no arguments.

arguments

Optional. Any arguments to be passed to the new object's constructor.

Remarks: JScript new Operator

The new operator performs the following tasks:

·   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.

·   The constructor then initializes the object according to the arguments passed to the constructor.

These are examples of valid uses of the new operator:

my_object = new Object;

my_array = new Array();

my_date = new Date("Jan 5 1996");

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