title: jQuery compare arrays and display unmatched values
body: <p>I am trying to compare two arrays and display the values that do not match.</p>
  
  <p>Using jQuery, I have this:</p>
  
  <pre><code>$.each(array1, function(key, value)
  {
    var index = $.inArray(value, array2);
    if(index != -1)
    {
      console.log(index);
    }
  });
  </code></pre>
  
  <p>Using the above code, I can find the array elements that match.</p>
  
  <p>For example, the array1 looks like this:</p>
  
  <pre><code>"GESU687543", "TCNU315504", "TGHU394463"
  </code></pre>
  
  <p>array2 looks like this:</p>
  
  <pre><code>"TCNU315504", "TRIU805499", "CMAU029901", "GESU687543", "TGHU394463", "NEUL0325B"
  </code></pre>
  
  <p>But the console will only display 3, 0, 4 because those values exist in both arrays. I want to do the exact opposite.  I need to find the values that don't match and display those values to the page.</p>
  
  <p>So, using my examples above, the values that should be displayed to the console are:</p>
  
  <pre><code>"TRIU805499", "CMAU029901", "NEUL0325B"
  </code></pre>
  
  <h2>Edit</h2>
  
  <p>SO advised me that this question is possibly a duplicate:  <a href="https://stackoverflow.com/questions/1187518/javascript-array-difference">How to get the difference between two arrays in Javascript?</a></p>
  
  <p>With that said, that page is using JavaScript. I'm strictly using jQuery here.</p>