How to store integer indexed data in Javascript?
<p>I'm coming from working in PHP for many years and having trouble wrapping my head around creating some more complicated data structures in JS for objects that are integer IDed. I need to build an object the stores these simpler objects hierarchically keyed on their integer ids. So if I have the following objectes each of which has a unique integer id:</p>

<p>section, element, item, entry</p>

<p>in php I would do something like</p>

<pre><code>$arr[$section_id][$element_id][$item_id][$entry_id] = $entry;
</code></pre>

<p>In javascript this does not work. I know I could technically wrap those IDs in quotes to force it but that seems like a bad idea. Similarly I could create an object and use the quoted integer approach but again that seems hacky. </p>

<p>Right now I am storing the data in regular integer indexed arrays and then using caolan's async detect to look up a particular member by ID. This works but seems extremely messy compared to the php equivalent. I'm hoping there's a cleaner way to do this in JS.</p>

<p>TIA!</p>
