Creation

There are two ways to create an object in JavaScript:

  1. literal

     var object = {};
       // Yes, simply a pair of curly braces!
    

    this is the recomended way.

  2. and object-oriented

     var object = new Object();
    

    it's almost like Java.