title: How to properly check if a Set is empty
body: <p>I've come with a question regarding the best way to check if a Javascript <strong>Set</strong> is empty. According with <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Set" rel="noreferrer">documentation</a>, there is no a straightforward method to check or get Set items.</p>
  
  <p>I think it happens same with <strong>Map</strong>.</p>
  
  <p>I've come up with some ideas (Node.js), but I'm not quite sure what's better.</p>
  
  <pre class="lang-js prettyprint-override"><code>const assert = require('assert');
  
  const emptySet = new Set()
  assert.strictEqual(![...emptySet].length, true)
  assert.strictEqual(emptySet.values().next().value === undefined, true)
  assert.strictEqual(emptySet.entries().next().value === undefined, true)
  
  const twoItemsSet = new Set([ 'foo', 'bar' ])
  assert.strictEqual(![...twoItemsSet].length, false)
  assert.strictEqual(twoItemsSet.values().next().value === undefined, false)
  assert.strictEqual(twoItemsSet.entries().next().value === undefined, false)
  </code></pre>