new (Operator/unary)

An object construction operator.


ECMAScript edition - 2
JavaScript - 1.0
JScript - 1.0
Internet Explorer - 3.02
Netscape - 2.0
Netscape Enterprise Server version - 2.0
Opera - 3.0
Property/method value type:An object whose type depends on the constructor
JavaScript syntax:-myObject = new aConstructor
-myObject = new anObject(someArguments)
Argument list:aConstructorAn object constructor function
anObjectAn object to clone
someArgumentsA collection of initial values for the new instance

The new operator creates a new instance of the object it is operating on.

As the object is created, the receiver's Construct method is called with no arguments passed to it. Any initialization is only carried out by the Construct method.

The associativity is from right to left.

Refer to the Operator Precedence topic for details of execution order.

Typically this would be used to instantiate core objects of the following types:

This can also be used to instantiate some host objects.

See also:Array(), Associativity, Boolean(), Date(), Function(), Left-Hand-Side expression, List type, Number(), Object(), Operator Precedence, RegExp(), String()


ECMA 262 edition 2 - section - 11.2.2

ECMA 262 edition 2 - section - 11.2.4

ECMA 262 edition 2 - section - 15

ECMA 262 edition 3 - section - 11.2.2

Wrox Instant JavaScript - page - 15

Wrox Instant JavaScript - page - 21