Why does this Integer become a string in javascript? : <p>So this little snippet of code takes an array <code>A</code> of integers and makes the integers strings when they become the keys of <code>pairs</code>.  Why?  Python is happy for them to remain integers, but Javascript seems to only want strings for keys.</p>

<pre><code>    var pairs = {};
    for(var i=0; i &lt; A.length; ++i) {
        var value = A[i];
        if(pairs[value]) {
            delete pairs[value];
        } else {
            pairs[value] = true;
        }
    }
    console.log(A, pairs)
</code></pre>

<p>Produces:</p>

<pre><code>Example test:    [9, 3, 9, 3, 9, 7, 9] 
Output:
[ 9, 3, 9, 3, 9, 7, 9 ] { '7': true }
OK 

Your test case:  [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9] 
Output:
[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5, 6, 7, 8, 9 ] { '10': true }
Returned value: 10 
</code></pre>

<p>All the keys are integers when they are added to the pairs object, but they become strings when they are used as keys.  This is a good bit different from python</p>
