Any programming language has some conception of an array or a collection of items that all share some common features or use. JavaScript has a few of them: arrays and sets. Both of these structures contain items, and in many ways, they are similar in usage, too, in that they can be enumerated, iterated over, and displayed for purposes of logical construction.
Let's first look at arrays.
Arrays
Arrays can contain different data types. This is a fully viable array:
const myArray = ['hello',1,'goodbye',null,true,1,'hello',{ 0 : 1 }]
It contains strings, numbers, Booleans, null, and an object. This is fine! While in practice you may not be mixing data types, there's nothing preventing you from doing so.
There is a quirk about using typeof() on arrays: since they're not true primitives, typeof(myArray) will return object. You should keep that in mind as you write JavaScript.
As we saw before in Chapter 3, Nitty-Gritty Grammar, ...