Javascript arrays are typically implemented as hashmaps (just like Javascript objects) with one added feature: there is an attribute length
, which is one higher than the highest positive integer that has been used as a key. Nothing stops you from also using strings, floating-point numbers, even negative numbers as keys. Nothing except good sense.