• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Basic Objects

When you see how easy it is to make an object, you’ll probably be surprised. In fact, when you created associative arrays (or what I’d call “generic objects”) in Chapter 11, “Arrays,” and Chapter 12, “Objects,” you were actually making objects. Individual objects are just a way to store multiple pieces of data in one variable. A quick way to both create and populate a generic object follows this form (which I call the “one-liner”):

myData={age:35,height:72,citizenship:"USA"};


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint