title: Get key value of dictionary by index in jQuery
body: <p>I have a javascript dictionary object which has a pre-set keys that are defaulted to <code>0</code>. Then I need to loop through the elements of this dictionary by <strong>index</strong> and use the value of the key to set its value. Below is my code to make things easier to understand:</p>
  
  <pre><code>var _map = {
      'severity-normal': 0,
      'severity-minimal': 0,
      'severity-moderate': 0,
      'severity-severe': 0,
      'severity-highly-severe': 0
  };
  
      mapSeverities: function () {
          for (var i = 0; i &lt; _map.length; i++) {
              //get the key value, ex: severity-normal, by index (which would by i)
              var key = //retrieved key value
              _map[key] = this.data(key);
          }
      }
  </code></pre>
  
  <p>In other words, suppose we're dealing with C#, I want to get the <code>KeyValuePair</code> at a certain index, then access its <code>Key</code> and <code>Value</code> properties.</p>
  
  <p>Any suggestions? </p>