Literal Objects


Keys in the object don't need to be quoted, unless they contain special characters, like a dash.

examples/objects/object.js
"use strict";

var email = {
   "from"      : "js@bar.com",
   "to"        : [ "foo@bar.com", "qux@bar.com" ],
   "subject"   : "Hello World",
   "mime-type" : "text"
};
console.log(email);

Object { from: "js@bar.com", to: Array[2], subject: "Hello World", mime-type: "text" }