title: How to reliably check an object is an EcmaScript 6 Map/Set?
body: <p>I just want to check that an object is a <code>Map</code> or <code>Set</code> and not an <code>Array</code>.</p>
  
  <p>to check an Array I'm using lodash's <code>_.isArray</code>.</p>
  
  <pre><code>function myFunc(arg) {
    if (_.isArray(arg)) {
      // doSomethingWithArray(arg)
    }
  
    if (isMap(arg)) {
      // doSomethingWithMap(arg)
    }
  
    if (isSet(arg)) {
      // doSomethingWithSet(arg)
    }
  }
  </code></pre>
  
  <p>If I were to implement <code>isMap</code>/<code>isSet</code>, what does it need to look like? I'd like for it to be able to catch subclasses of <code>Map</code>/<code>Set</code> if possible as well.</p>