Create Objects

Objects are usually created by using the New keyword followed by an object constructor function. For example:

var x=new MyConstructor();

See new.

The constructor is a special function you create that assigns default property values. You can also create an object using the default object constructor Object. For example:

var x=new Object();

See Object.

Once you create an object, you can assign values to its properties as follows:

x.name="Pi";
x.value=3.1415;

See Work with Objects.