title: HashMap objects in javascript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/684672/loop-through-javascript-object">Loop through JavaScript object</a><br>
    <a href="https://stackoverflow.com/questions/8763125/get-array-of-objects-keys">Get array of object’s keys</a>  </p>
  </blockquote>
  
  
  
  <p>Is there a way to use hashmaps in javascript. I found <a href="https://stackoverflow.com/questions/4246980/how-to-create-a-simple-map-using-javascript-jquery">this</a> page which shows one way of having hashmaps in javascript. Based on that I am storing the data as below:</p>
  
  <pre><code>var map = new Object();
  map[myKey1] = myObj1;
  map[myKey2] = myObj2;
  
  function get(k) {
     return map[k];
  }
  </code></pre>
  
  <p>But I want the keySet (all the keys) of the <code>map</code> object just like it is done in Java (<code>map.keySet();</code>).</p>
  
  <p>Can anyone show me how can get all the keys present in this object?</p>