title: How to use .map() over Map keys in Javascript
body: <p>When using the Javascript built in <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="noreferrer">Map</a>, <strong>how do you use .map() to iterate over the keys?</strong></p>
  
  <p>I know the for...of can be used as shown below:</p>
  
  <pre><code>const map = new Map();
  
  map.set(0, 'Zero');
  map.set(1, 'One');
  map.set(2, 'Two');
  
  for (let key of map.keys()) {
    console.log(key);
  }
  </code></pre>
  
  <p>But this code will fail:</p>
  
  <pre><code>map.keys().map(key =&gt; {
    console.log(key);
  });
  </code></pre>