Back in Chapter 3, we saw that primitive datatypes—strings, numbers, Booleans, null, and undefined—represent basic information in our scripts. We also saw that ActionScript supports several composite datatypes, which can group several pieces of data together into a single datum.
The array type is the first composite datatype we'll study. Arrays are used to store and manipulate ordered lists of information and are, therefore, fundamental tools in sequential, repetitive programming. We use them to do everything from storing values retrieved via a user-input form, to generating pull-down menus, to keeping track of enemy spacecraft in a game. In its most basic form, an array is just a list of items, like your grocery list or the entries in your checkbook ledger.