title: Check if an object exists twice in an array
body: <p>I have an array containing objects with this structure: </p>
  
  <pre><code>var results = [{
      AuthorId: 2,
      Id: 89,
      caseId: 33 //some key
  },...];
  </code></pre>
  
  <p>Now, I want to check if the objects in this array exist 2 or more times and log them in the console.</p>
  
  <p>My approach:</p>
  
  <pre><code>$.each(results, function (i, result) {
      var stringRes = result.AuthorId + ";" + result.caseId;
      $.each(results, function (j, toTest) {
          if (j &lt;= results.length - 2) {
              var stringToTest = results[j + 1].AuthorId + ";" + results[j + 1].caseId;
              if (stringToTest == stringRes) {
                  console.log(result.Id);
                  //some function to do something with duplicates
              }
           }
      });
  });
  </code></pre>
  
  <p>Firstly, I know making strings and comparing them isn't really good. Secondly, this will log every item at least once, because every item compares to each other (= the item compares itself to itself).</p>
  
  <p>Is this fixable with a (more or less) fast and reliable way?</p>