title: Filter javascript map object by array of keys
body: <p>I have an array of keys:</p>
  
  <pre><code>var arr = ['var1', 'var2', 'var3']
  </code></pre>
  
  <p>I also have a Javascript map object containing four keys (var1, var2, var3, var4) and values (1, 2, 3, 4) which I want to filter by the arr-array so I get a new map object only containing the keys (var1, var2, var3) and values (1, 2, 3). Does anyone know how I can do this?</p>