An array in JavaScript is a type of object that is specialized in that it contains a set of ordered elements.
You can express an array using its literal syntax, which is a comma-separated list of expressions delimited by square brackets:
const friends = ['Rachel', 'Monica', 'Ross', 'Joe', 'Phoebe', 'Chandler'];
These comma-separated expressions can be as complex or simple as we desire:
[
[1, 2, 3],
function() {},
Symbol(),
{
title: 'wow',
foo: function() {}
}
]
An array is capable of containing all manner of values. There are very few constraints on how we can use arrays. Technically, an array's limited to a length of around 4 billion, due to its length being stored as a 32-bit integer. For most purposes, of course, this should be absolutely fine.
Arrays have a numeric property...