new

The new operator is used to create a new instance of any valid JavaScript static object, a full list of which can be found below.

• Array

• Boolean

• Date

• Function

• Number

• Object

• RegExp

• String

You may use any applicable expressions as the conditions within quotes for these objects. The expressions may be stated at the creation time of that instance of the object.

syntax:

new objectType

var objectName = new objectType

EXAMPLE

var serialNumbers = new Array(79HU676, 68GK789, 57FGT768)

This example shows the creation of a new Array object, named serialNumbers. It contains three serial numbers, which can be accessed using the usual techiniques for accessing an array's contents.