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

Chapter 10. Arrays > Naming Array Elements

Naming Array Elements

Most array elements are numbered, but they can also be named. Naming array elements is an easy way to keep information organized within an array. None of these named elements can be manipulated by array methods, nor can they be seen when the array is traced.

There are two ways to create named array elements. The first uses dot syntax, and the second uses brackets and string literals. Here's an example of both methods:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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