Arrays
In JavaScript, an array is a type of variable used to store sequences of values or a series of objects. Declare an array using square brackets, with items separated by commas.
To access a single value in the array, use bracket notation with the index number, which indicates the item's position within the array, starting at 0. For example, given quickArray
above:
would return the first value, 12
.
An array can be populated with other variables.
When writing objects directly into an array, ensure that square and curly brackets are properly organized.
See the Pen Arrays (IMS322 Docs) by Eric Sheffield (@ersheff) on CodePen.
```