title: Using Array objects as key for ES6 Map
body: <p>I am trying to update my code to ES6 as I am using Node 4.0 and really like its features so far. However I have problems with the new ES6 <code>Map</code> data structure as it behaves differently to <code>{}</code> when using <code>Array</code> as a key. I am using it as a counter map.</p>
  
  <p>I run this code and I would like to know how I can use arrays as keys for the <code>Map</code>.</p>
  
  <pre><code>"use strict";
  
  var a = new Map();
  a.set(['x','y'], 1);
  console.log(a.get(['x','y']));
  
  var b = {};
  b[['x','y']] = 1;
  
  console.log(b[['x','y']]);
  </code></pre>
  
  <p>It prints out the following and the first line should be <code>1</code> and not <code>undefined</code>:</p>
  
  <pre><code>undefined
  1
  </code></pre>
  
  <p>The original JS map stringifies the key and I am not wanting to do the same type of stringify hack with the new ES6 <code>Map</code>. </p>
  
  <p>What can I do to use arrays as keys reliably for a ES6 <code>Map</code>?</p>