title: Why can't I iterate the properties of my ES6 Map?
body: <p>In the Node.js REPL:</p>
  
  <pre><code>&gt; var map = new Map();
  undefined
  &gt; map['foo'] = 'bar';
  'bar'
  &gt; map['bar'] = 'baz';
  'baz'
  &gt; map
  Map { foo: 'bar', bar: 'baz' }
  &gt; map.forEach(console.log);
  undefined
  </code></pre>
  
  <p>As you can see, the <code>foo</code> and <code>bar</code> keys are clearly defined within <code>map</code>, but when I try to iterate over them with <code>Map.prototype.forEach</code>, nothing happens - but <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Iterating_Maps_with_forEach()" rel="nofollow">according to MDN, it should</a>. Note also that <code>Map.prototype.forEach</code> <em>is defined</em>, so it's not just that this method hasn't been implemented yet. I've also tried using a <code>for ... of ...</code> loop, with the same result - the code I provide to be run for each iteration doesn't actually run, even though <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Iterating_Maps_with_for..of" rel="nofollow">it should</a>.</p>
  
  <p>I'm on Node.js v4.4.4. I searched the web for "javascript map isn't iterable node" and the like, with no luck.</p>
  
  <p>What's going on here?</p>