Skip to content

Latest commit

 

History

History
19 lines (13 loc) · 330 Bytes

creation.md

File metadata and controls

19 lines (13 loc) · 330 Bytes

Creation

There are two ways to create an object in JavaScript:

  1. literal

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

    Note: this is the recomended way.

  2. and object-oriented

    var object = new Object();

    Note: it's almost like Java.