We have learned that a variable can hold one value. For example:
let i = 1;
We can assign only one literal value to
i. We cannot assign multiple literal values to a variable
An array is a special type of variable, which can store multiple values using special syntax.
Every value is associated with a numeric index starting with 0. The following figure illustrates how an array stores values.
The top row indicates value while the bottom row indicates the index of the array uses to store information.5.2 Declaring and Initializing Arrays