title: Reverse an ES6 Map
body: <p>Suppose I have created a Map object like this <code>Map {"a" =&gt; "apple", "b" =&gt; "banana"}</code>:</p>
  
  <pre><code>m = new Map([ ["a", "apple"], ["b", "banana"] ]);
  </code></pre>
  
  <p>Now I want to reverse it and get <code>Map {"b" =&gt; "banana", "a" =&gt; "apple"}</code></p>
  
  <p>I see the only way to do it as follows:</p>
  
  <pre><code>new Map(Array.from(m.entries()).reverse());
  </code></pre>
  
  <p>which doesn't look neither concise nor straightforward. Is there a nicer way?</p>