Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Up to this point, most of the reference-value examples have used the Object type, which is one of the most often-used types in ECMAScript. Although instances of Object don’t have much functionality, they are ideally suited to storing and transmitting data around an application.
There are two ways to explicitly create an instance of Object. The first is to use the new operator with the Object constructor like this:
var person = new Object(); person.name = "Nicholas"; person.age = 29;
ObjectTypeExample01.htm
The other way is to use object literal notation. Object literal notation is a shorthand form of object definition designed to simplify creating an object with numerous properties. For example, the following defines the same person object from the previous example using object literal notation: