HTML and CSS Reference
ular expressions, numbers, and other useful entities. The good news is that the core
objects are consistent across different implementations and platforms and were stan-
dardized by the ECMAScript 1.0 specification, allowing programs to be portable.
Although each object has a set of properties and methods that further define it, this topic
does not detail every one, but highlights those that will be used most often. For a com-
An array is a collection of like values—called elements —such as an array of colors,
an array of strings, or an array of images. Each element of the array is accessed with an
index value enclosed in square brackets (see Figure 9.1). An index is also called a sub-
script. There are two types of index values: a nonnegative integer and a string. Arrays
indexed by numbers are called numeric arrays and arrays indexed by strings are called
Figure 9.1 A numeric Array object called color. Index values are numbers.