title: What is the fastest or most elegant way to compute a set difference using Javascript arrays?
body: <p>Let <code>A</code> and <code>B</code> be two sets. I'm looking for <em>really</em> fast or elegant ways to compute the set difference (<code>A - B</code> or <code>A \B</code>, depending on your preference) between them. The two sets are stored and manipulated as Javascript arrays, as the title says.</p>
  
  <p>Notes:</p>
  
  <ul>
  <li>Gecko-specific tricks are okay</li>
  <li>I'd prefer sticking to native functions (but I am open to a lightweight library if it's way faster)</li>
  <li>I've seen, but not tested, <a href="http://jsclass.jcoglan.com/set.html" rel="noreferrer">JS.Set</a> (see previous point)</li>
  </ul>
  
  <p><strong>Edit:</strong> I noticed a comment about sets containing duplicate elements. When I say "set" I'm referring to the mathematical definition, which means (among other things) that they do not contain duplicate elements.</p>