A good way to associate a counter to each member of an array in Javascript?
<p>I have an array of strings in Javascript like `var elements = ["string1", "string2"]; The array is created dynamically so it could contain any number of strings. I want to associate a counter to each element of the array. The counter will increment or decrement during the webpage's life.</p>

<p>I was going to try <code>element["string1"].counter = 1</code>; but it didn't work.</p>

<p>What's a good way to implement this?</p>
