Wednesday, February 29, 2012

JavaScript Object Literal

JavaScript Object Literal: "What is an object literal? In nontechnical terms, it is a means of containing a lot of data in one tidy package. It is a comma separated list of name value pairs wrapped in curly braces. In JavaScript an object literal is declared or defined as follows:

var myObject = {}
An object literal with a few properties, from a Rotating Images example:

var myRotator = {
path: 'images/',
speed: 4500,
images: ["smile.gif", "grim.gif", "frown.gif", "bomb.gif"]
}"

'via Blog this'