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

Chapter 11. Arrays > Referencing Array Elements

11.4. Referencing Array Elements

Once we've created an array, we'll inevitably want to retrieve or change the value of its elements. To do so, we can use the array access operator (i.e., square brackets), [ ], which we introduced in Chapter 5.

11.4.1. Retrieving an Element's Value

To access an individual element, specify the array's identifier, followed by the element's index within square brackets, like this:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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