Creation

There are two ways to create an object in JavaScript:

  1. literal

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

    Note: this is the recomended way.

  2. and object-oriented

    1. var object = new Object();

    Note: it’s almost like Java.