The JavaScript equivalent of an "associative array" is simply a generic object, not actual instances of Array. I do not recommend ever using an array that way.
In general, you should never stick non-numeric properties onto an instance of Array. While it will work at a basic level, that's only because arrays in JavaScript are just objects and that's how objects work. Nothing actively expects or supports using arrays thus. That's why non-numeric properties added to arrays aren't restored, because they never get serialized in the first place.
And now to address the W3Schools elephant in the room (from Chapel's answer).
Edit. I was not aware that JavaScript attempted to coerce arrays with non-numeric indexes into objects, though, that is cool.
Arrays are already objects, just ones with a prototype (the Array object) and some very minor special handling.
As far as jamming non-numeric properties onto instances of Array. Doing so changes absolutely nothing about the array, save for adding the non-numeric properties to it. Its type doesn't change at all. Whoever wrote that was very, very wrong (then again, it's from W3Schools, so that should be expected).
W3Schools has been a hive of stupid for, literally, decades (I'm firmly convinced that anything they get right is an accident). Anyone who wants accurate information about JavaScript, and/or other web technologies, should go to MDN.