Why can't I assign a string of numbers as a key in a javascript object?
<p>This is done in the node shell:</p>

<pre><code>&gt; results = []
[]
&gt; num = 5
5
&gt; results[num] = []
[]
&gt; results
[ , , , , , [] ]
&gt;
</code></pre>

<p>And even if I try to stringify the number:</p>

<pre><code>&gt; results = []
[]
&gt; num = 5
5
&gt; results[num.toString()] = []
[]
&gt; results
[ , , , , , [] ]
&gt; results['5'] = []
[]
&gt; results
[ , , , , , [] ]
&gt;
</code></pre>

<p>It would seem that javascript is interpreting a string as a number in the definition of an object?</p>

<p>I'd like the results to look like this: </p>

<pre><code>results = [ { '5' : [
                   { key : value },
                   { key2 : value }
                  ]
            }
          ]
</code></pre>
