title: Is there any way to use a numeric type as an object key?
body: <p>It seems that when I use a numeric type as a key name in an object, it always gets converted to a string. Is there anyway to actually get it to store as a numeric? The normal typecasting does not seem to work.</p>
  
  <p>Example:</p>
  
  <pre><code>var userId = 1;
  console.log( typeof userId ); // number
  myObject[userId] = 'a value';
  console.dir(myObject);
  </code></pre>
  
  <p>Dir Output:</p>
  
  <pre><code>{
      '1': 'a value'
  }
  </code></pre>
  
  <p>What I <strong>want</strong> is this:</p>
  
  <pre><code>{
      1: 'a value'
  }
  </code></pre>
  
  <p>Advice?</p>