• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Arrays > Creating Arrays

11.3. Creating Arrays

We can create a new array with a data literal (i.e., by simply specifying its elements in a comma-separated list enclosed in brackets) or with the built-in array constructor function, Array( ).

11.3.1. Array Literals

Usually, it's more convenient to create arrays using array literals than to create them with the Array( ) constructor. Recall that a literal is a direct representation of a piece of fixed data. For example:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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