ECMA-262 Core: JavaScript Array Data Type

Navigation Aids -- This Page        Navigation Aids -- This Topic        Navigation Aids -- This Site

Introduction And Review

The topic of JS arrays is covered from three perspectives:

The Array data type is one of three ECMAScript reference data types. The other two reference types are: Function Type and Object Type.

The Array type is distinguished from other types using a dynamic or weak typing method. The method involves interrogating the value token of the defining literal. The Array literal is distinguished from all other types by a special syntax of the defining literal. The Array literal is a set of data values separated by commas, that are enclosed by a set of square brackets.

Our page entitled "JavaScript Data" will describe how JS data types interplay with the following topics:

Reference Types (also called Composite Data Types)

The Array data type is a member of the reference type group. This group also contains the Function data type and the Object data type. Sometimes all three types, Array, Function and Object are referred to as "Object types" in a generic context.

At our site, we sometimes refer to the reference data types as "composite data types". The reference data types have some unique characteristics when compared to there cousins, the primitive data types.

Array Data Values

An array's elements can contain any type of data value. An element may hold any of the primitive data types as well as any of the composite types. In fact, any given array can hold any and all of the data types. One data type per element, but any given element can hold any one of the data types. This capability is illustrated at this link.

Creating an Array

The JS practitioner has two methods available for creating an Array type data structure.

  1. The Array Class Constructor
  2. Array Literal

Array Class Members

Once our array of the Array type is created, this same array has access to the members of the Array class type.

Array Terminology

The array element and array index are two different terms that both refer to array data (take the links if you need clarification).

Two Kinds of Arrays

There are two basic kinds of arrays. The typical and most common array is the index array. A second kind of array is the associative array.


Rx4AJAX        About Us | Topic Index | Contact Us | Privacy Policy | 2008 This Site Built By PPThompson