I am able to insert a value at an arbitrary index outside of the bounds of the array like so.
> const a = []
undefined
> a[999] = true
true
> a
[ <999 empty items>, true ]
I suspect that v8 is not creating 999 empty items under the hood and Arrays work more like Objects and instead we are creating a hidden class which has one key which is the key 999
at offset 0
. Is this correct?