Learning web development: Arrays in JavaScript
Briefly

Arrays are a way to store multiple values in a single variable using the array literal syntax. An array is created with an opening square bracket, elements separated by commas, and a closing square bracket. Elements are accessed via indices starting at zero, understanding that the last element can be accessed by the array's length minus one. Variables declared with const can reference mutable values like arrays, meaning the elements of the array can change, while immutable types like numbers and strings cannot be modified directly.
Arrays allow storing multiple values in a single variable. They are defined using square brackets and can contain elements of different types separated by commas.
Accessing array elements is done via numeric indices starting from zero. The last element in an array can be found using the array's length minus one.
Variables declared with const can hold mutable values such as arrays, allowing modification of the array content without reassigning a new array to the variable.
Immutable types such as numbers and strings cannot be changed in place; instead, a new value must be assigned to the variable to replace the current value.
Read at 2ality
[
|
]