title: jQuery unique array function applied to an array of objects
body: <p>I am trying to apply the jQuery $.unique() function to an array of objects. I enjoy using this function with an array of primative variables but apparently it doesn't work with objects, as seen here: <a href="http://jsfiddle.net/abs10gxo/" rel="nofollow">http://jsfiddle.net/abs10gxo/</a></p>
  
  <pre><code>var arr1 = [ 
      "aaa",
      "bbb",
      "aaa" 
  ];
  
  console.log($.unique(arr1));  // Works as expected.
  
  var arr2 = [ 
      { "a": "aaa" }, 
      { "b": "bbb" }, 
      { "a": "aaa" } 
  ];
  
  console.log($.unique(arr2));  // Doesn't work as expected.
  </code></pre>
  
  <p>I can't seem to find any literature on jQuery.com in regard to using this function with an array of objects; it only adheres to primative types. Can anyone recommend a solution? Library or custom are both welcome answers. I am familiar with doing this in C++ where you can overload the comparative <code>==</code> sign operator but not sure if that is the best approach since I am using jQuery.</p>