JavaScript Introduction | Arrays

Arrays

What is an array?

In JavaScript, an array is defined as an ordered set of values referenced by a name and an index. Each value that makes up an array is called an array element, and the number that indicates a position in the array is called an index.

Arrays in JavaScript have the following characteristics.

  1. The type of array elements is not fixed, so elements in the same array can have different types.
  2. Array element indexes do not need to be continuous, so specific array elements can be empty.
  3. In JavaScript, arrays are handled as Array objects.