Are there any downsides to storing properties on Javascript arrays?
<p>I know that Javascript Arrays are actually objects, and because they are objects, they can have properties. Here's an example:</p>

<pre><code>var a = [1, 2, 3];
a.currentIndex = 2;
a.next = function() { ... };
a.prev = function() { ... };

a.length // returns 3
</code></pre>

<p>To me this seems like it could come in very handy. I see numerous reasons why you might want to store state or utility functions on the actual array itself and not on some other variable. It even seems better than having the array as a property of an object with the other stuff stored on that object.</p>

<p><strong>Here's my question:</strong></p>

<p>Does anyone know of any issues with storing properties on a Javascript array? Does it work in all browsers? Is there any evidence that this will change with future versions of Javascript? Is there any general wisdom about whether or not it's a good practice?</p>

<p>(p.s. For the record, I don't need to iterate over the array with a for...in loop. I understand that such a loop would include the properties as well)</p>
