be confusing. Here are the main points of this chapter in review:
object can have array elements, and any array can have
In Navigator 3.0, there are three methods that can be used to
- You can can convert an array, and all of
its elements into a single string with the
- You can reverse the
order of elements in an array with the
- You can sort
the elements of an array with the
- In Navigator 3.0 and Internet Explorer 3.0, array elements
and object properties do not overlap and cannot overwrite
each other. There is an Array()
constructor, and arrays created with this constructor have a
(read-only in IE 3.0) length property
that is automatically maintained so that it always contains
a value one greater than the largest index of the array.
- In Navigator 2.0, object properties and array elements
overlap; when you create a new property, it is as if you
added a new array element one higher than the highest
existing element. There is no built-in
Array() constructor, but you can
write your own. Also, there is no automatically maintained
length property, but it is common to
reserve element 0 of an array for a size
property (which you update yourself as the array grows).
- For many algorithms, the size of an array is maintained in a
variable externally to an array, and there is no need for a
length or size property.
arrays, and can be "sparse"--i.e., they can contain
non-contiguous elements. Usually, though, you'll use arrays
as if they were non-associative, fixed-size arrays like those
found in C, C++, and Java.