title: Javascript map with composite keys
body: <p>In JavaScript I want to store values to compound keys, similar to a C# dictionary with a tuple as key. This is where I came across the Map class. However, it does not seem to work quite as well as I would like it to. Here's my current approach:</p>
  
  <pre class="lang-js prettyprint-override"><code>var test = new Map();
  
  test.set({a: 1, b: 1}, 'Bla');
  test.set({a: 5, b: 7}, 'Blub');
  
  test.get({a: 1, b: 1}); // ==&gt; Returns undefined; would expect 'Bla'
  </code></pre>
  
  <p>I guess, that this has something to do that both objects with <code>{a: 1, b: 1}</code> have a different memory address and therefore are the same, but not identical. The <code>Dictionary</code> class in c# uses a hash function in background. Is there something similar in JS? Or a much easier approach?</p>
  
  <p>My real key object consistst of three strings.</p>