A sequential array, e.g.
[1,2,3], is implemented in a linear storage buffer (memory). Once array is full it increases in size. While convention is for it to double in size implementations differ.
JS allows you to specify any i-th element in an array. For example:
const array = ; array = 1; array = 2; array = 3;
In this case
array is not defined.
It is an array hole and this type of array is called a sparse array.
In this case V8 will use a hash table to store the elements of the array.
This eliminates the space wasted by empty spots.
HYPOTHESIS: Since a sparse array is implemented as an actual hash table, it may be faster to use an array instead of an object when you desire a hash table for your own application with numeric keys, e.g. sequential primary IDs. For example:
const map =  map = 'blah' map = 'foo'
RESULT: No difference in performance. Why?
- implemented using shape trees
- can be used as a hash table
- but its better to use an array for this