Object literals are a popular way to create new objects with a specific set of properties,
as opposed to explicitly creating a new instance of Object and then adding properties.
For example, this pattern is rarely used:
var book = new Object();
book.title = " JavaScript";
book.author = "K. Zakas";
Object literals allow you to specify all of the properties within two curly braces. Literals
effectively perform the same tasks as their nonliteral counterparts, just with more compact
syntax.
as opposed to explicitly creating a new instance of Object and then adding properties.
For example, this pattern is rarely used:
var book = new Object();
book.title = " JavaScript";
book.author = "K. Zakas";
Object literals allow you to specify all of the properties within two curly braces. Literals
effectively perform the same tasks as their nonliteral counterparts, just with more compact
syntax.