Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

object literals and array literals in javascript

var Swapper = {
  // Swapper is object literal 
    // and images is array literal
    images: ["smile.gif", "grim.gif", "frown.gif", "bomb.gif"],
    pos: { // nested object literal
        x: 40,
        y: 300
    }
};
Source by www.dyn-web.com #
 
PREVIOUS NEXT
Tagged: #object #literals #array #literals #javascript
ADD COMMENT
Topic
Name
8+1 =