Array

noun
  • computing
    a construct for storing contiguous data.
All terms

Description

An array is a computer programming construct for storing contiguous data. Typically, arrays are used in an expression like this:

[2, 3, 5, 7]

In plain language, this represents an array containing four elements: 2, 3, 5, and 7. The position of an element in an array is called the index. For example, the element at index zero is two and the element at index one is three and so on.

If we have a variable that refers to the array, like shown below, each element can be accessed using the syntax a[i] where a is the name of the variable and i is the index of the element you want to retrieve.

a = [2, 3, 5, 7]
a[0] = 2
a[1] = 3