title: javascript's equivalent of java's Map.getKey()
body: <p>I have a map or say an associative array kind of structure in JavaScript:</p>
  
  <pre><code>var myMap = {"one": 1, "two": 2, "three": 3};
  </code></pre>
  
  <p>To get keys corresponding to a given value I have to iterate through the map:</p>
  
  <pre><code>function map_test(value) {
    var myMap = {"one": 1, "two": 2, "three": 3};   
    for (key in myMap) {
      if (myMap[key] == value) {
         alert(key);
         break;
      }
    }
  }
  </code></pre>
  
  <p>Is there some function like Java's <code>Map.getKey()</code> 
  or a better way of getting keys?</p>