title: Remove all elements contained in another array
body: <p>I am looking for an efficient way to remove all elements from a javascript array if they are present in another array.</p>
  
  <pre><code>// If I have this array:
  var myArray = ['a', 'b', 'c', 'd', 'e', 'f', 'g'];
  
  // and this one:
  var toRemove = ['b', 'c', 'g'];
  </code></pre>
  
  <p>I want to operate on myArray to leave it in this state: <code>['a', 'd', 'e', 'f']</code></p>
  
  <p>With jQuery, I'm using <code>grep()</code> and <code>inArray()</code>, which works well:</p>
  
  <pre><code>myArray = $.grep(myArray, function(value) {
      return $.inArray(value, toRemove) &lt; 0;
  });
  </code></pre>
  
  <p>Is there a pure javascript way to do this without looping and splicing?</p>