Each item in an array is called an array element, and each element has a unique numeric position (index) by which we can refer to it.
Like a variable, each array element can be assigned any value. An entire array, then, is akin to a collection of sequentially named variables, but instead of each item having a different name, each item has an element number (the first element is number 0, not number 1). To manipulate the values in an array's elements, we ask for them by number.
An element's position in the array is known as its index. We use an element's index to set or retrieve the element's value or to work with the element in various ways. Some of the array-handling methods, for example, use element indexes to specify ranges of elements for processing.
We can also insert and delete elements from the beginning, end, or even middle of an array. An array can have gaps (that is, some elements can be empty). We can have elements at positions 0 and 4, without requiring anything in positions 1, 2, and 3. Arrays with gaps are called sparse arrays.
At any point during its life span, a given array has a specific number of elements (both empty and occupied). The number of elements in an array is called the array's length, which we'll discuss later in this chapter.