Arrays

This lesson highlights the key features of the array data structure.

The Structure

An array stores elements of the same data type. What makes arrays unique is that they are not always immutable like tuples and records. An array can be static, which is immutable, or dynamic, which is mutable.

Similar to strings, an array of n elements is indexed from 0 to n-l. This means the first element of the array is considered to be at the zeroth position.

The contents of an array are enclosed in the [| |] operators.

Get hands-on with 1200+ tech skills courses.