Javascript - Object Reference Types

Introduction

A reference value, object, is an instance of a specific reference type.

In ECMAScript, reference types groups data and functionality together.

New objects are created by using the new operator followed by a constructor.

A constructor is simply a function whose purpose is to create a new object.

Consider the following line of code:

var person = new Object();

This code creates a new instance of the Object reference type and stores it in the variable person.

The constructor being used is Object(), which creates a simple object with only the default properties and methods.