title: Invert a Map object
body: <p>I was wondering, what is the most convenient way to invert keys and values in a Map. Is there any builtin method or should it be done by iterating over keys and values?</p>
  
  <pre><code>const map: Map&lt;string, number&gt; = new Map()
  </code></pre>
  
  <pre><code>const inverse: Map&lt;number, string&gt;
  </code></pre>