title: Map vs Object in JavaScript
body: <p>I just discovered <a href="https://www.chromestatus.com/features/4818609708728320" rel="noreferrer">this feature</a>:</p>
  <blockquote>
  <p>Map: Map objects are simple key/value maps.</p>
  </blockquote>
  <p>That confused me. Regular JavaScript objects are dictionaries, so how is a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="noreferrer"><code>Map</code></a> different from a dictionary? Conceptually, they're identical (according to <a href="https://stackoverflow.com/questions/2884068/what-is-the-difference-between-a-map-and-a-dictionary">another question on Stack Overflow</a>)</p>
  <p>The documentation doesn't help either:</p>
  <blockquote>
  <p>Map objects are collections of key/value pairs where both the keys and values may be arbitrary ECMAScript language values. A distinct key value may only occur in one key/value pair within the Map’s collection. Distinct key values as discriminated using the a comparision algorithm that is selected when the Map is created.</p>
  </blockquote>
  <blockquote>
  <p>A Map object can iterate its elements in insertion order. Map object must be implemented using either hash tables or other mechanisms that, on average, provide access times that are sublinear on the number of elements in the collection. The data structures used in this Map objects specification is only intended to describe the required observable semantics of Map objects. It is not intended to be a viable implementation model.</p>
  </blockquote>
  <p>…still sounds like an object to me, so clearly I've missed something.</p>
  <p>Why is JavaScript gaining a (well-supported) <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map" rel="noreferrer"><code>Map</code></a> object? What does it do?</p>